Displaying 1-9 of 9 results found.
page
1
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
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
A285321bi(row, col) = if(1==row, A019565(col), A065642(A285321bi(row-1, col)));
A004736(n)= { 1 + binomial(1 + floor(1/2 + sqrt(2*n)), 2) - 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 (A285325bi row col) ( A048675 (A285321bi row col)))
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
PROG
(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
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
COMMENTS
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
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
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
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).
(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.
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)
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:
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] }];
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)
(Python)
from operator import mul
from functools import reduce
from sympy import prime
return reduce(mul, (prime(i+1) for i, v in enumerate(bin(n)[:1:-1]) if v == '1')) if n > 0 else 1
(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
Cf. A007088, A030308, A000040, A013929, A005117, A103785, A103786, A110765, A064273, A246353, A283475, A283477, A285319, A285331, A285332, A288569, A293442.
Cf. A285315 (numbers for which a(n) < n), A285316 (for which a(n) > n).
Even bisection (which contains the odd terms): A332382.
Least prime index of a(n) is A001511.
EXTENSIONS
Definition corrected by Klaus-R. Löffler, Aug 20 2014
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
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
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
(End)
a(n^2) = a(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
(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))
(Scheme)
CROSSREFS
Cf. A000040, A000120, A001221, A005117, A008479, A019565, A055396, A285320, A285321, A285329, A285330, A285332.
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.
Cf. A000720, A005940, A018819, A023506, A071814, A225620, A277319, A277905, A304818, A372689, A372890.
AUTHOR
Mitch Cervinka (puritan(AT)planetkc.com), Oct 26 2003
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
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.
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]
(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
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
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
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:
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
(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
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
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
FORMULA
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.]
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
for(n=0, 4095, write("b285332.txt", n, " ", A285332(n)));
(Scheme, with memoization-macro definec)
(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))
CROSSREFS
Cf. A007947, A019565, A033845, A048675, A065642, A087207, A109162, A285319, A285320, A285328, A285330, A285333, A286542, A286543.
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
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
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 (A284311bi row col) (if (= 1 row) ( A005117 (+ 1 col)) ( A065642 (A284311bi (- row 1) col))))
CROSSREFS
Cf. A284457 (this sequence read by antidiagonals upwards), A285321 (a similar array, but columns come in different order).
Cf. A008479 (index of the row where n is located), A285329 (of the column).
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
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)).
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
(Scheme)
(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)
Search completed in 0.017 seconds
|