[go: up one dir, main page]

login
Search: a285321 -id:a285321
     Sort: relevance | references | number | modified | created      Format: long | short | data
Square array A(n,k) = A048675(A285321(n,k)), read by descending antidiagonals: A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...
+20
6
1, 2, 2, 3, 4, 3, 4, 4, 6, 4, 5, 8, 5, 8, 5, 6, 6, 12, 5, 10, 6, 7, 8, 7, 16, 6, 12, 7, 8, 8, 10, 9, 20, 6, 14, 8, 9, 16, 9, 10, 8, 24, 7, 16, 9, 10, 10, 24, 9, 12, 10, 28, 7, 18, 10, 11, 12, 11, 32, 11, 14, 9, 32, 7, 20, 11, 12, 12, 18, 17, 40, 10, 12, 11, 36, 8, 22, 12, 13, 16, 13, 14, 12, 48, 10, 14, 13, 40, 8, 24, 13
OFFSET
1,2
FORMULA
A(n,k) = A048675(A285321(n,k)).
EXAMPLE
The top left 15x6 corner of the array:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
2, 4, 4, 8, 6, 8, 8, 16, 10, 12, 12, 16, 14, 16, 16
3, 6, 5, 12, 7, 10, 9, 24, 11, 18, 13, 20, 15, 18, 17
4, 8, 5, 16, 9, 10, 9, 32, 17, 14, 13, 20, 17, 22, 17
5, 10, 6, 20, 8, 12, 11, 40, 12, 20, 14, 24, 21, 18, 19
6, 12, 6, 24, 10, 14, 10, 48, 18, 16, 19, 28, 16, 20, 18
PROG
(PARI)
A019565(n) = {my(j, v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
A007947(n) = factorback(factorint(n)[, 1]); \\ Andrew Lelechenko, May 09 2014
A065642(n) = { my(r=A007947(n)); if(1==n, n, n = n+r; while(A007947(n) <> r, n = n+r); n); };
A285321bi(row, col) = if(1==row, A019565(col), A065642(A285321bi(row-1, col)));
A002260(n)= { n-binomial((sqrtint(8*n)+1)\2, 2); }; \\ M. F. Hasler, Mar 10 2014
A004736(n)= { 1 + binomial(1 + floor(1/2 + sqrt(2*n)), 2) - n; };
A285321(n) = A285321bi(A002260(n), A004736(n));
A048675(n) = my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; \\ Michel Marcus, Oct 10 2016
for(n=1, 120, write("b285325.txt", n, " ", A285325(n)));
(Scheme)
(define (A285325 n) (A285325bi (A002260 n) (A004736 n)))
(define (A285325bi row col) (A048675 (A285321bi row col)))
CROSSREFS
Row 1 & column 1: A000027.
Row 2: A285326, Row 3: A285327.
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Apr 17 2017
STATUS
approved
Transpose of square array A285321.
+20
3
2, 4, 3, 8, 9, 6, 16, 27, 12, 5, 32, 81, 18, 25, 10, 64, 243, 24, 125, 20, 15, 128, 729, 36, 625, 40, 45, 30, 256, 2187, 48, 3125, 50, 75, 60, 7, 512, 6561, 54, 15625, 80, 135, 90, 49, 14, 1024, 19683, 72, 78125, 100, 225, 120, 343, 28, 21
OFFSET
1,1
COMMENTS
See A285321.
PROG
(Scheme) (define (A285322 n) (A285321bi (A004736 n) (A002260 n))) ;; For A285321bi, see A285321.
(Python)
from operator import mul
from sympy import prime, primefactors
def a019565(n): return reduce(mul, (prime(i+1) for i, v in enumerate(bin(n)[:1:-1]) if v == '1')) if n > 0 else 1 # This function from Chai Wah Wu
def a007947(n): return 1 if n<2 else reduce(mul, primefactors(n))
def a065642(n):
if n==1: return 1
r=a007947(n)
n = n + r
while a007947(n)!=r:
n+=r
return n
def A(n, k): return a019565(k) if n==1 else a065642(A(n - 1, k))
for n in range(1, 11): print [A(n - k + 1, k) for k in range(1, n + 1)] # Indranil Ghosh, Apr 19 2017
CROSSREFS
Transpose: A285321.
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Apr 17 2017
STATUS
approved
The squarefree numbers ordered lexicographically by their prime factorization (with factors written in decreasing order). a(n) = Product_{k in I} prime(k+1), where I is the set of indices of nonzero binary digits in n = Sum_{k in I} 2^k.
+10
322
1, 2, 3, 6, 5, 10, 15, 30, 7, 14, 21, 42, 35, 70, 105, 210, 11, 22, 33, 66, 55, 110, 165, 330, 77, 154, 231, 462, 385, 770, 1155, 2310, 13, 26, 39, 78, 65, 130, 195, 390, 91, 182, 273, 546, 455, 910, 1365, 2730, 143, 286, 429, 858, 715, 1430, 2145, 4290
OFFSET
0,2
COMMENTS
A permutation of the squarefree numbers A005117. The missing positive numbers are in A013929. - Alois P. Heinz, Sep 06 2014
From Antti Karttunen, Apr 18 & 19 2017: (Start)
Because a(n) toggles the parity of n there are neither fixed points nor any cycles of odd length.
Conjecture: there are no finite cycles of any length. My grounds for this conjecture: any finite cycle in this sequence, if such cycles exist at all, must have at least one member that occurs somewhere in A285319, the terms that seem already to be quite rare. Moreover, any such a number n should satisfy in addition to A019565(n) < n also that A048675^{k}(n) is squarefree, not just for k=0, 1 but for all k >= 0. As there is on average a probability of only 6/(Pi^2) = 0.6079... that any further term encountered on the trajectory of A048675 is squarefree, the total chance that all of them would be squarefree (which is required from the elements of A019565-cycles) is soon minuscule, especially as A048675 is not very tightly bounded (many trajectories seem to skyrocket, at least initially). I am also assuming that usually there is no significant correlation between the binary expansions of n and A048675(n) (apart from their least significant bits), or, for that matter, between their prime factorizations.
See also the slightly stronger conjecture in A285320, which implies that there would neither be any two-way infinite cycles.
If either of the conjectures is false (there are cycles), then certainly neither sequence A285332 nor its inverse A285331 can be a permutation of natural numbers. (End)
The conjecture made in A087207 (see also A288569) implies the two conjectures mentioned above. A further constraint for cycles is that in any A019565-trajectory which starts from a squarefree number (A005117), every other term is of the form 4k+2, while every other term is of the form 6k+3. - Antti Karttunen, Jun 18 2017
The sequence satisfies the exponential function identity, a(x + y) = a(x) * a(y), whenever x and y do not have a 1-bit in the same position, i.e., when A004198(x,y) = 0. See also A283475. - Antti Karttunen, Oct 31 2019
The above identity becomes unconditional if binary exclusive OR, A003987(.,.), is substituted for addition, and A059897(.,.), a multiplicative equivalent of A003987, is substituted for multiplication. This gives us a(A003987(x,y)) = A059897(a(x), a(y)). - Peter Munn, Nov 18 2019
Also the Heinz number of the binary indices of n, where the Heinz number of a sequence (y_1,...,y_k) is prime(y_1)*...*prime(y_k), and a number's binary indices (A048793) are the positions of 1's in its reversed binary expansion. - Gus Wiseman, Dec 28 2022
LINKS
FORMULA
G.f.: Product_{k>=0} (1 + prime(k+1)*x^2^k), where prime(k)=A000040(k). - Ralf Stephan, Jun 20 2003
a(n) = f(n, 1, 1) with f(x, y, z) = if x > 0 then f(floor(x/2), y*prime(z)^(x mod 2), z+1) else y. - Reinhard Zumkeller, Mar 13 2010
For all n >= 0: A048675(a(n)) = n; A013928(a(n)) = A064273(n). - Antti Karttunen, Jul 29 2015
a(n) = a(2^x)*a(2^y)*a(2^z)*... = prime(x+1)*prime(y+1)*prime(z+1)*..., where n = 2^x + 2^y + 2^z + ... - Benedict W. J. Irwin, Jul 24 2016
From Antti Karttunen, Apr 18 2017 and Jun 18 2017: (Start)
a(n) = A097248(A260443(n)), a(A005187(n)) = A283475(n), A108951(a(n)) = A283477(n).
A055396(a(n)) = A001511(n), a(A087207(n)) = A007947(n). (End)
a(2^n - 1) = A002110(n). - Michael De Vlieger, Jul 05 2017
a(n) = A225546(A000079(n)). - Peter Munn, Oct 31 2019
From Peter Munn, Mar 04 2022: (Start)
a(2n) = A003961(a(n)); a(2n+1) = 2*a(2n).
a(x XOR y) = A059897(a(x), a(y)) = A089913(a(x), a(y)), where XOR denotes bitwise exclusive OR (A003987).
a(n+1) = A334747(a(n)).
a(x+y) = A331590(a(x), a(y)).
a(n) = A336322(A008578(n+1)).
(End)
EXAMPLE
5 = 2^2+2^0, e_1 = 2, e_2 = 0, prime(2+1) = prime(3) = 5, prime(0+1) = prime(1) = 2, so a(5) = 5*2 = 10.
From Philippe Deléham, Jun 03 2015: (Start)
This sequence regarded as a triangle withs rows of lengths 1, 1, 2, 4, 8, 16, ...:
1;
2;
3, 6;
5, 10, 15, 30;
7, 14, 21, 42, 35, 70, 105, 210;
11, 22, 33, 66, 55, 110, 165, 330, 77, 154, 231, 462, 385, 770, 1155, 2310;
...
(End)
From Peter Munn, Jun 14 2020: (Start)
The initial terms are shown below, equated with the product of their prime factors to exhibit the lexicographic order. We start with 1, since 1 is factored as the empty product and the empty list is first in lexicographic order.
n a(n)
0 1 = .
1 2 = 2.
2 3 = 3.
3 6 = 3*2.
4 5 = 5.
5 10 = 5*2.
6 15 = 5*3.
7 30 = 5*3*2.
8 7 = 7.
9 14 = 7*2.
10 21 = 7*3.
11 42 = 7*3*2.
12 35 = 7*5.
(End)
MAPLE
a:= proc(n) local i, m, r; m:=n; r:=1;
for i while m>0 do if irem(m, 2, 'm')=1
then r:=r*ithprime(i) fi od; r
end:
seq(a(n), n=0..60); # Alois P. Heinz, Sep 06 2014
MATHEMATICA
Do[m=1; o=1; k1=k; While[ k1>0, k2=Mod[k1, 2]; If[k2\[Equal]1, m=m*Prime[o]]; k1=(k1-k2)/ 2; o=o+1]; Print[m], {k, 0, 55}] (* Lei Zhou, Feb 15 2005 *)
Table[Times @@ Prime@ Flatten@ Position[#, 1] &@ Reverse@ IntegerDigits[n, 2], {n, 0, 55}] (* Michael De Vlieger, Aug 27 2016 *)
b[0] := {1}; b[n_] := Flatten[{ b[n - 1], b[n - 1] * Prime[n] }];
a = b[6] (* Fred Daniel Kline, Jun 26 2017 *)
PROG
(PARI) a(n)=factorback(vecextract(primes(logint(n+!n, 2)+1), n)) \\ M. F. Hasler, Mar 26 2011, updated Aug 22 2014, updated Mar 01 2018
(Haskell)
a019565 n = product $ zipWith (^) a000040_list (a030308_row n)
-- Reinhard Zumkeller, Apr 27 2013
(Python)
from operator import mul
from functools import reduce
from sympy import prime
def A019565(n):
return reduce(mul, (prime(i+1) for i, v in enumerate(bin(n)[:1:-1]) if v == '1')) if n > 0 else 1
# Chai Wah Wu, Dec 25 2014
(Scheme) (define (A019565 n) (let loop ((n n) (i 1) (p 1)) (cond ((zero? n) p) ((odd? n) (loop (/ (- n 1) 2) (+ 1 i) (* p (A000040 i)))) (else (loop (/ n 2) (+ 1 i) p))))) ;; (Requires only the implementation of A000040 for prime numbers.) - Antti Karttunen, Apr 20 2017
CROSSREFS
Row 1 of A285321.
Equivalent sequences for k-th-power-free numbers: A101278 (k=3), A101942 (k=4), A101943 (k=5), A054842 (k=10).
Cf. A109162 (iterates).
Cf. also A048675 (a left inverse), A087207, A097248, A260443, A054841.
Cf. A285315 (numbers for which a(n) < n), A285316 (for which a(n) > n).
Cf. A276076, A276086 (analogous sequences for factorial and primorial bases), A334110 (terms squared).
For partial sums see A288570.
A003961, A003987, A004198, A059897, A089913, A331590, A334747 are used to express relationships between sequence terms.
Column 1 of A329332.
Even bisection (which contains the odd terms): A332382.
A160102 composed with A052330, and subsequence of the latter.
Related to A000079 via A225546, to A057335 via A122111, to A008578 via A336322.
Least prime index of a(n) is A001511.
Greatest prime index of a(n) is A029837 or A070939.
Taking prime indices gives A048793, reverse A272020, row sums A029931.
A112798 lists prime indices, length A001222, sum A056239.
KEYWORD
nonn,look,tabf
AUTHOR
EXTENSIONS
Definition corrected by Klaus-R. Löffler, Aug 20 2014
New name from Peter Munn, Jun 14 2020
STATUS
approved
A binary representation of the primes that divide a number, shown in decimal.
+10
50
0, 1, 2, 1, 4, 3, 8, 1, 2, 5, 16, 3, 32, 9, 6, 1, 64, 3, 128, 5, 10, 17, 256, 3, 4, 33, 2, 9, 512, 7, 1024, 1, 18, 65, 12, 3, 2048, 129, 34, 5, 4096, 11, 8192, 17, 6, 257, 16384, 3, 8, 5, 66, 33, 32768, 3, 20, 9, 130, 513, 65536, 7, 131072, 1025, 10, 1, 36, 19, 262144, 65, 258
OFFSET
1,3
COMMENTS
The binary representation of a(n) shows which prime numbers divide n, but not the multiplicities. a(2)=1, a(3)=10, a(4)=1, a(5)=100, a(6)=11, a(10)=101, a(30)=111, etc.
For n > 1, a(n) gives the (one-based) index of the column where n is located in array A285321. A008479 gives the other index. - Antti Karttunen, Apr 17 2017
From Antti Karttunen, Jun 18 & 20 2017: (Start)
A268335 gives all n such that a(n) = A248663(n); the squarefree numbers (A005117) are all the n such that a(n) = A285330(n) = A048675(n).
For all n > 1 for which the value of A285331(n) is well-defined, we have A285331(a(n)) <= floor(A285331(n)/2), because then n is included in the binary tree A285332 and a(n) is one of its ancestors (in that tree), and thus must be at least one step nearer to its root than n itself.
Conjecture: Starting at any n and iterating the map n -> a(n), we will always reach 0 (see A288569). This conjecture is equivalent to the conjecture that at any n that is neither a prime nor a power of two, we will eventually hit a prime number (which then becomes a power of two in the next iteration). If this conjecture is false then sequence A285332 cannot be a permutation of natural numbers. On the other hand, if the conjecture is true, then A285332 must be a permutation of natural numbers, because all primes and powers of 2 occur in definite positions in that tree. This conjecture also implies the conjectures made in A019565 and A285320 that essentially claim that there are neither finite nor infinite cycles in A019565.
If there are any 2-cycles in this sequence, then both terms of the cycle should be present in A286611 and the larger one should be present in A286612.
(End)
Binary rank of the distinct prime indices of n, where the binary rank of an integer partition y is given by Sum_i 2^(y_i-1). For all prime indices (with multiplicity) we have A048675. - Gus Wiseman, May 25 2024
FORMULA
Additive with a(p^e) = 2^(i-1) where p is the i-th prime. - Vladeta Jovovic, Oct 29 2003
a(n) gives the m such that A019565(m) = A007947(n). - Naohiro Nomoto, Oct 30 2003
A000120(a(n)) = A001221(n); a(n) = Sum(2^(A049084(p)-1): p prime-factor of n). - Reinhard Zumkeller, Nov 30 2003
G.f.: Sum_{k>=1} 2^(k-1)*x^prime(k)/(1-x^prime(k)). - Franklin T. Adams-Watters, Sep 01 2009
From Antti Karttunen, Apr 17 2017, Jun 19 2017 & Dec 06 2018: (Start)
a(n) = A048675(A007947(n)).
a(1) = 0; for n > 1, a(n) = 2^(A055396(n)-1) + a(A028234(n)).
A000035(a(n)) = 1 - A000035(n). [a(n) and n are of opposite parity.]
A248663(n) <= a(n) <= A048675(n). [XOR-, OR- and +-variants.]
a(A293214(n)) = A218403(n).
a(A293442(n)) = A267116(n).
A069010(a(n)) = A287170(n).
A007088(a(n)) = A276379(n).
A038374(a(n)) = A300820(n) for n >= 1.
(End)
From Peter Munn, Jan 08 2020: (Start)
a(A059896(n,k)) = a(n) OR a(k) = A003986(a(n), a(k)).
a(A003961(n)) = 2*a(n).
a(n^2) = a(n).
a(n) = A267116(A225546(n)).
a(A225546(n)) = A267116(n).
(End)
EXAMPLE
a(38) = 129 because 38 = 2*19 = prime(1)*prime(8) and 129 = 2^0 + 2^7 (in binary 10000001).
a(140) = 13, binary 1101 because 140 is divisible by the first, third and fourth primes and 2^(1-1) + 2^(3-1) + 2^(4-1) = 13.
MATHEMATICA
a[n_] := Total[ 2^(PrimePi /@ FactorInteger[n][[All, 1]] - 1)]; a[1] = 0; Table[a[n], {n, 1, 69}] (* Jean-François Alcover, Dec 12 2011 *)
PROG
(Haskell)
a087207 = sum . map ((2 ^) . (subtract 1) . a049084) . a027748_row
-- Reinhard Zumkeller, Jul 16 2013
(PARI) a(n) = {if (n==1, 0, my(f=factor(n), v = []); forprime(p=2, vecmax(f[, 1]), v = concat(v, vecsearch(f[, 1], p)!=0); ); fromdigits(Vecrev(v), 2)); } \\ Michel Marcus, Jun 05 2017
(PARI) A087207(n)=vecsum(apply(p->1<<primepi(p-1), factor(n)[, 1])) \\ Significantly faster than using sum(...). - M. F. Hasler, Jun 23 2017
(Python)
from sympy import factorint, primepi
def a(n):
return sum(2**primepi(i - 1) for i in factorint(n))
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 06 2017
(Scheme)
(definec (A087207 n) (if (= 1 n) 0 (+ (A000079 (+ -1 (A055396 n))) (A087207 (A028234 n))))) ;; This uses memoization-macro definec
(define (A087207 n) (A048675 (A007947 n))) ;; Needs code from A007947 and A048675. - Antti Karttunen, Jun 19 2017
CROSSREFS
For partial sums see A288566.
Sequences with related definitions: A007947, A008472, A027748, A048675, A248663, A276379 (same sequence shown in base 2), A288569, A289271, A297404.
Cf. A286608 (numbers n for which a(n) < n), A286609 (n for which a(n) > n), and also A286611, A286612.
A003986, A003961, A059896 are used to express relationship between terms of this sequence.
Related to A267116 via A225546.
Positions of particular values are: A000079\{1} (1), A000244\{1} (2), A033845 (3), A000351\{1} (4), A033846 (5), A033849 (6), A143207 (7), A000420\{1} (8), A033847 (9), A033850 (10), A033851 (12), A147576 (14), A147571 (15), A001020\{1} (16), A033848 (17).
A048675 gives binary rank of prime indices.
A061395 gives greatest prime index, least A055396.
A112798 lists prime indices, length A001222, reverse A296150, sum A056239.
Binary indices (listed A048793):
- length A000120, complement A023416
- min A001511, opposite A000012
- sum A029931, product A096111
- max A029837 or A070939, opposite A070940
- complement A368494, sum A359400
- opposite complement A371571, sum A359359
- opposite A371572, sum A230877
KEYWORD
nonn,base,nice
AUTHOR
Mitch Cervinka (puritan(AT)planetkc.com), Oct 26 2003
EXTENSIONS
More terms from Don Reble, Ray Chandler and Naohiro Nomoto, Oct 28 2003
Name clarified by Antti Karttunen, Jun 18 2017
STATUS
approved
a(1) = 1; for n > 1, a(n) = Min {m > n | m has same prime factors as n ignoring multiplicity}.
+10
42
1, 4, 9, 8, 25, 12, 49, 16, 27, 20, 121, 18, 169, 28, 45, 32, 289, 24, 361, 40, 63, 44, 529, 36, 125, 52, 81, 56, 841, 60, 961, 64, 99, 68, 175, 48, 1369, 76, 117, 50, 1681, 84, 1849, 88, 75, 92, 2209, 54, 343, 80, 153, 104, 2809, 72, 275, 98, 171, 116, 3481, 90, 3721
OFFSET
1,2
COMMENTS
After the initial 1, a permutation of the nonsquarefree numbers A013929. The array A284457 is obtained as a dispersion of this sequence. - Antti Karttunen, Apr 17 2017
Numbers such that a(n)/n is not an integer are listed in A284342.
LINKS
Reinhard Zumkeller (terms 1..1000) & Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
A007947(a(n)) = A007947(n); a(A007947(n)) = A007947(n) * A020639(n), where A007947 is the squarefree kernel (radical), A020639 is the least prime factor (lpf).
a(A000040(n)^k) = A000040(n)^(k+1); A001221(a(n)) = A001221(n).
A285328(a(n)) = n. - Antti Karttunen, Apr 17 2017
n < a(n) <= n*lpf(n) <= n^2. - Charles R Greathouse IV, Oct 18 2017
EXAMPLE
a(10) = a(2 * 5) = 2 * 2 * 5 = 20; a(12) = a(2^2 * 3) = 2 * 3^2 = 18.
MATHEMATICA
ffi[x_]:= Flatten[FactorInteger[x]]; lf[x_]:= Length[FactorInteger[x]]; ba[x_]:= Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}]; cor[x_]:= Apply[Times, ba[x]]; Join[{1}, Table[Min[Flatten[Position[Table[cor[w], {w, n+1, n^2}]-cor[n], 0]]+n], {n, 2, 100}]] (* This code is suitable since prime factor set is invariant iff squarefree kernel is invariant. *) (* G. C. Greubel, Oct 31 2018 *)
Array[If[# == 1, 1, Function[{n, c}, SelectFirst[Range[n + 1, n^2], Times @@ FactorInteger[#][[All, 1]] == c &]] @@ {#, Times @@ FactorInteger[#][[All, 1]]}] &, 61] (* Michael De Vlieger, Oct 31 2018 *)
PROG
(Haskell)
a065642 1 = 1
a065642 n = head [x | let rad = a007947 n, x <- [n+1..], a007947 x == rad]
-- Reinhard Zumkeller, Jun 12 2015, Jul 27 2011
(PARI) A065642(n)={ my(r=A007947(n)); if(1==n, n, n += r; while(A007947(n) <> r, n += r); n)} \\ Antti Karttunen, Apr 17 2017
(PARI) a(n)=if(n<2, return(1)); my(f=factor(n), r, mx, mn, t); if(#f~==1, return(f[1, 1]^(f[1, 2]+1))); f=f[, 1]; r=factorback(f); mn=mx=n*f[1]; forvec(v=vector(#f, i, [1, logint(mx/r, f[i])+1]), t=prod(i=1, #f, f[i]^v[i]); if(t<mn && t>n, mn=t)); mn \\ Charles R Greathouse IV, Oct 18 2017
(Scheme) (define (A065642 n) (if (= 1 n) n (let ((k (A007947 n))) (let loop ((n (+ n k))) (if (= (A007947 n) k) n (loop (+ n k))))))) ;; (Semi-naive implementation) - Antti Karttunen, Apr 17 2017
(Python)
from sympy import primefactors, prod
def a007947(n): return 1 if n < 2 else prod(primefactors(n))
def a(n):
if n==1: return 1
r=a007947(n)
n += r
while a007947(n)!=r:
n+=r
return n
print([a(n) for n in range(1, 51)]) # Indranil Ghosh, Apr 17 2017
CROSSREFS
Cf. A285328 (a left inverse).
Cf. also arrays A284457 & A284311, A285321 and permutations A284572, A285112, A285332.
KEYWORD
nice,nonn
AUTHOR
Reinhard Zumkeller, Dec 03 2001
STATUS
approved
Number of numbers <= n with same prime factors as n.
+10
30
1, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 4, 1, 3, 1, 2, 1, 1, 1, 4, 2, 1, 3, 2, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 3, 1, 1, 1, 2, 2, 1, 1, 6, 2, 4, 1, 2, 1, 7, 1, 3, 1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 2, 1, 1, 1, 8, 1, 1, 3, 2, 1, 1, 1, 5, 4, 1, 1, 2, 1, 1, 1, 3, 1, 3, 1, 2, 1, 1, 1, 9
OFFSET
1,4
COMMENTS
For n > 1, a(n) gives the (one-based) index of the row where n is located in arrays A284311 and A285321 or respectively, index of the column where n is in A284457. A285329 gives the other index. - Antti Karttunen, Apr 17 2017
LINKS
P. Erdős, T. Motzkin, Problem 5735, Amer. Math. Monthly, 78 (1971), 680-681. (Incorrect solution!)
H. N. Shapiro, Problem 5735, Amer. Math. Monthly, 97 (1990), 937.
FORMULA
a(n) = Sum_{k=1..n} (floor(n^k/k)-floor((n^k-1)/k))*(floor(k^n/n)-floor((k^n-1)/n)). - Anthony Browne, May 20 2016
If A008683(n) <> 0 [when n is squarefree, A005117], a(n) = 1, otherwise a(n) = 1+a(A285328(n)). - Antti Karttunen, Apr 17 2017
MAPLE
N:= 100: # to get a(1)..a(N)
V:= Vector(N):
V[1]:= 1:
for n from 2 to N do
if V[n] = 0 then
S:= {n};
for p in numtheory:-factorset(n) do
S := S union {seq(seq(s*p^k, k=1..floor(log[p](N/s))), s=S)};
od:
S:= sort(convert(S, list));
for k from 1 to nops(S) do V[S[k]]:= k od:
fi
od:
convert(V, list); # Robert Israel, May 20 2016
MATHEMATICA
PkTbl=Prepend[ Array[ Times @@ First[ Transpose[ FactorInteger[ # ] ] ]&, 100, 2 ], 1 ]; 1+Array[ Count[ Take[ PkTbl, #-1 ], PkTbl[ [ # ] ] ]&, Length[ PkTbl ] ]
Count[#, k_ /; k == Last@ #] & /@ Function[s, Take[s, #] & /@ Range@ Length@ s]@ Array[Map[First, FactorInteger@ #] &, 120] (* or *)
Table[Sum[(Floor[n^k/k] - Floor[(n^k - 1)/k]) (Floor[k^n/n] - Floor[(k^n - 1)/n]), {k, n}], {n, 120}] (* Michael De Vlieger, May 20 2016 *)
PROG
(Scheme) (define (A008479 n) (if (not (zero? (A008683 n))) 1 (+ 1 (A008479 (A285328 n))))) ;; Antti Karttunen, Apr 17 2017
(PARI) a(n)=my(f=factor(n)[, 1], s); forvec(v=vector(#f, i, [1, logint(n, f[i])]), if(prod(i=1, #f, f[i]^v[i])<=n, s++)); s \\ Charles R Greathouse IV, Oct 19 2017
CROSSREFS
KEYWORD
nonn,easy
STATUS
approved
a(0) = 1, a(1) = 2, a(2n) = A019565(a(n)), a(2n+1) = A065642(a(n)).
+10
18
1, 2, 3, 4, 6, 9, 5, 8, 15, 12, 14, 27, 10, 25, 7, 16, 210, 45, 35, 18, 105, 28, 462, 81, 21, 20, 154, 125, 30, 49, 11, 32, 10659, 420, 910, 75, 78, 175, 33, 24, 3094, 315, 385, 56, 780045, 924, 374, 243, 110, 63, 55, 40, 4389, 308, 170170, 625, 1155, 60, 286, 343, 42, 121, 13, 64, 54230826, 31977, 28405, 630, 1330665, 1820, 714
OFFSET
0,2
COMMENTS
Note the indexing: the domain starts from 0, while the range excludes zero.
This sequence can be represented as a binary tree. Each left hand child is produced as A019565(n), and each right hand child as A065642(n), when the parent node contains n >= 2:
1
|
...................2...................
3 4
6......../ \........9 5......../ \........8
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
15 12 14 27 10 25 7 16
210 45 35 18 105 28 462 81 21 20 154 125 30 49 11 32
etc.
Where will 38 appear in this tree? It is a reasonable assumption that by iterating A087207 starting from 38, as A087207(38) = 129, A087207(129) = 8194, A087207(8194) = 1501199875790187, ..., we will eventually hit a prime A000040(k), most likely with a largish index k. This prime occurs at the penultimate edge at right, as a(A000918(k)) = a((2^k)-2), and thus 38 occurs somewhere below it as a(m) = 38, m > k. All the numbers that share prime factors with 38, namely 76, 152, 304, 608, 722, ..., occur similarly late in this tree, as they form the rightward branch starting from 38. Alternatively, by iterating A285330 (each iteration moves one step towards the root) starting from 38, we might instead first hit some power of 3, or say, one of the terms of A033845 (the rightward branch starting from 6), in which case the first prime encountered would be a(2)=3 and 38 would appear on the left-hand side instead of the right-hand side subtree.
As long as it remains conjecture that A019565 has no cycles, it is certainly also an open question whether this is a permutation of the natural numbers: If A019565 has any cycles, then neither any of the terms in those cycles nor any A065642-trajectories starting from those terms (that is, numbers sharing same prime factors) may occur in this tree.
Sequence exhibits some outrageous swings, for example, a(703) = 224, but a(704) is 1427 decimal digits (4739 binary digits) long, thus it no longer fits into a b-file.
However, the scatter plot of A286543 gives some flavor of the behavior of this sequence even after that point. - Antti Karttunen, Dec 25 2017
LINKS
Michael De Vlieger, Diagram of the binary tree of a(n) showing 1 <= n <= 2^8.
Antti Karttunen and David J. Seal, Discussion on SeqFan mailing list
FORMULA
a(0) = 1, a(1) = 2, a(2n) = A019565(a(n)), a(2n+1) = A065642(a(n)).
For n >= 0, a(2^n) = A109162(2+n). [The left edge of the tree.]
For n >= 0, a(A000225(n)) = A000079(n). [Powers of 2 occur at the right edge of the tree.]
For n >= 2, a(A000918(n)) = A000040(n). [And the next vertices inwards contain primes.]
For n >= 2, a(A036563(1+n)) = A001248(n). [Whose right children are their squares.]
For n >= 0, a(A055010(n)) = A000244(n). [Powers of 3 are at the rightmost edge of the left subtree.]
For n >= 2, a(A129868(n-1)) = A062457(n).
A048675(a(n)) = A285333(n).
A046523(a(n)) = A286542(n).
MATHEMATICA
Block[{a = {1, 2}}, Do[AppendTo[a, If[EvenQ[i], Times @@ Prime@ Flatten@ Position[#, 1] &@ Reverse@ IntegerDigits[a[[i/2 + 1]], 2], If[# == 1, 1, Function[{n, c}, SelectFirst[Range[n + 1, n^2], Times @@ FactorInteger[#][[All, 1]] == c &]] @@ {#, Times @@ FactorInteger[#][[All, 1]]}] &[a[[(i - 1)/2 + 1]] ] ]], {i, 2, 70}]; a] (* Michael De Vlieger, Mar 12 2021 *)
PROG
(PARI)
A019565(n) = {my(j, v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
A007947(n) = factorback(factorint(n)[, 1]); \\ From Andrew Lelechenko, May 09 2014
A065642(n) = { my(r=A007947(n)); if(1==n, n, n = n+r; while(A007947(n) <> r, n = n+r); n); };
A285332(n) = { if(n<=1, n+1, if(!(n%2), A019565(A285332(n/2)), A065642(A285332((n-1)/2)))); };
for(n=0, 4095, write("b285332.txt", n, " ", A285332(n)));
(Scheme, with memoization-macro definec)
(definec (A285332 n) (cond ((<= n 1) (+ n 1)) ((even? n) (A019565 (A285332 (/ n 2)))) (else (A065642 (A285332 (/ (- n 1) 2))))))
(Python)
from operator import mul
from sympy import prime, primefactors
def a007947(n): return 1 if n<2 else reduce(mul, primefactors(n))
def a019565(n): return reduce(mul, (prime(i+1) for i, v in enumerate(bin(n)[:1:-1]) if v == '1')) if n > 0 else 1 # This function from Chai Wah Wu
def a065642(n):
if n==1: return 1
r=a007947(n)
n = n + r
while a007947(n)!=r:
n+=r
return n
def a(n):
if n<2: return n + 1
if n%2==0: return a019565(a(n//2))
else: return a065642(a((n - 1)//2))
print([a(n) for n in range(51)]) # Indranil Ghosh, Apr 18 2017
CROSSREFS
Inverse: A285331.
Compare also to permutation A285112 and array A285321.
KEYWORD
nonn,tabf
AUTHOR
Antti Karttunen, Apr 17 2017
STATUS
approved
Array T(n,k) read by antidiagonals (downward): T(1,k) = A005117(k+1) (squarefree numbers > 1); for n > 1, columns are nonsquarefree numbers (in ascending order) with exactly the same prime factors as T(1,k).
+10
11
2, 3, 4, 5, 9, 8, 6, 25, 27, 16, 7, 12, 125, 81, 32, 10, 49, 18, 625, 243, 64, 11, 20, 343, 24, 3125, 729, 128, 13, 121, 40, 2401, 36, 15625, 2187, 256, 14, 169, 1331, 50, 16807, 48, 78125, 6561, 512, 15, 28, 2197, 14641, 80, 117649, 54, 390625, 19683, 1024
OFFSET
1,1
COMMENTS
A permutation of the natural numbers > 1.
T(1,k)= A005117(m) with m > 1; terms in column k = T(1,k) * A162306(T(1,k)) only not bounded by T(1,k). Let T(1,k) = b. Terms in column k are multiples of b and numbers c such that c | b^e with e >= 0. Alternatively, terms in column k are multiples bc with c those numbers whose prime divisors p also divide b. - Michael De Vlieger, Mar 25 2017
LINKS
FORMULA
From Antti Karttunen, Apr 17 2017: (Start)
A(1,k) = A005117(1+k), A(n,k) = A065642(A(n-1,k)).
A(A008479(n), A285329(n)) = n for all n >= 2.
(End)
EXAMPLE
Array starts:
2 3 5 6 7 10 11 13 14 15
4 9 25 12 49 20 121 169 28 45
8 27 125 18 343 40 1331 2197 56 75
16 81 625 24 2401 50 14641 371293 98 135
32 243 3125 36 16807 80 161051 4826809 112 225
64 729 15625 48 117649 100 1771561 62748517 196 375
128 2187 78125 54 823543 160 19487171 815730721 224 405
Column 6 is: T(1,6) = 2*5; T(2,6) = 2^2*5; T(3,6) = 2^3*5; T(4,6) = 2*5^2; T(5,6) = 2^4*5, etc.
MATHEMATICA
f[n_, k_: 1] := Block[{c = 0, sgn = Sign[k], sf}, sf = n + sgn; While[c < Abs[k], While[! SquareFreeQ@ sf, If[sgn < 0, sf--, sf++]]; If[sgn < 0, sf--, sf++]; c++]; sf + If[sgn < 0, 1, -1]] (* after Robert G. Wilson v at A005117 *); T[n_, k_] := T[n, k] = Which[And[n == 1, k == 1], 2, k == 1, f@ T[n - 1, k], PrimeQ@ T[n, 1], T[n, 1]^k, True, Module[{j = T[n, k - 1]/T[n, 1] + 1}, While[PowerMod[T[n, 1], j, j] != 0, j++]; j T[n, 1]]]; Table[T[n - k + 1, k], {n, 10}, {k, n}] // Flatten (* Michael De Vlieger, Mar 25 2017 *)
PROG
(Scheme)
(define (A284311 n) (A284311bi (A002260 n) (A004736 n)))
(define (A284311bi row col) (if (= 1 row) (A005117 (+ 1 col)) (A065642 (A284311bi (- row 1) col))))
;; Antti Karttunen, Apr 17 2017
CROSSREFS
Cf. A005117 (squarefree numbers), A033845 (column 4), columns 1,2,3,5 are powers of primes, A033846 (column 6), A033847 (column 9), A033849 (column 10).
The columns that are powers of primes have indices A071403(n) - 1. - Michel Marcus, Mar 24 2017
See also A007947; the k-th column of the array corresponds to the numbers with radical A005117(k+1). - Rémy Sigrist, Mar 24 2017
Cf. A284457 (this sequence read by antidiagonals upwards), A285321 (a similar array, but columns come in different order).
Cf. A065642.
Cf. A008479 (index of the row where n is located), A285329 (of the column).
KEYWORD
nonn,tabl
AUTHOR
Bob Selcoe, Mar 24 2017
STATUS
approved
a(n) = A065642(A065642(A019565(n))) / A019565(n).
+10
3
1, 4, 9, 3, 25, 4, 5, 3, 49, 4, 7, 3, 7, 4, 5, 3, 121, 4, 9, 3, 11, 4, 5, 3, 11, 4, 7, 3, 7, 4, 5, 3, 169, 4, 9, 3, 13, 4, 5, 3, 13, 4, 7, 3, 7, 4, 5, 3, 13, 4, 9, 3, 11, 4, 5, 3, 11, 4, 7, 3, 7, 4, 5, 3, 289, 4, 9, 3, 17, 4, 5, 3, 17, 4, 7, 3, 7, 4, 5, 3, 17, 4, 9, 3, 11, 4, 5, 3, 11, 4, 7, 3, 7, 4, 5, 3, 17, 4, 9, 3, 13, 4, 5, 3, 13, 4, 7, 3, 7, 4, 5, 3
OFFSET
0,2
COMMENTS
After the initial a(0)=1, the third row of array A285321 divided by its first row. After 1, all terms are either primes or squares of primes. See A285110.
The sequence is completely determined by the positions of two least significant 1-bits of n: After initial zero, if n is a power of two (only one 1-bit present) or if prime(1+A285099(n)) > prime(1+A007814(n))^2, a(n) = prime(1+A007814(n))^2 = A020639(A019565(n))^2, otherwise a(n) = prime(1+A285099(n)) = A014673(A019565(n)).
LINKS
FORMULA
a(n) = A065642(A065642(A019565(n))) / A019565(n).
PROG
(PARI)
A019565(n) = {my(j, v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
A007947(n) = factorback(factorint(n)[, 1]); \\ From Andrew Lelechenko, May 09 2014
A065642(n) = { my(r=A007947(n)); if(1==n, n, n = n+r; while(A007947(n) <> r, n = n+r); n); };
(Scheme)
(define (A285323 n) (/ (A065642 (A065642 (A019565 n))) (A019565 n)))
(define (A285323 n) (cond ((zero? n) 1) ((or (= 1 (A000120 n)) (> (A000040 (+ 1 (A285099 n))) (A000290 (A000040 (+ 1 (A007814 n)))))) (A000290 (A000040 (+ 1 (A007814 n))))) (else (A000040 (+ 1 (A285099 n))))))
(Python)
from operator import mul
from sympy import prime, primefactors
from functools import reduce
def a019565(n): return reduce(mul, (prime(i+1) for i, v in enumerate(bin(n)[:1:-1]) if v == '1')) if n > 0 else 1 # This function from Chai Wah Wu
def a007947(n): return 1 if n<2 else reduce(mul, primefactors(n))
def a065642(n):
if n==1: return 1
r=a007947(n)
n += r
while a007947(n)!=r:
n+=r
return n
def a(n): return a065642(a065642(a019565(n)))//a019565(n)
print([a(n) for n in range(101)]) # Indranil Ghosh, Apr 20 2017
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 19 2017
STATUS
approved

Search completed in 0.017 seconds