cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 17 results. Next

A285331 Inverse for A285332: a(1) = 0, a(2) = 1, a(A019565(n)) = 2*a(n), a(A065642(n)) = 1 + 2*a(n).

Original entry on oeis.org

0, 1, 2, 3, 6, 4, 14, 7, 5, 12, 30, 9, 62, 10, 8, 15, 126, 19, 254, 25, 24, 252, 510, 39, 13, 76, 11, 21, 1022, 28, 2046, 31, 38, 316, 18, 79, 4094
Offset: 1

Views

Author

Antti Karttunen, Apr 17 2017, comments edited Apr 19 2017

Keywords

Comments

Note the indexing: the domain starts from 1, while the range includes also zero.
For the question whether this sequence and A285332 are permutations of natural numbers, see comments in A285332 and the conjecture stated in A019565.
As a practical problem, it seems next-to-impossible to compute even the value of a(38). Even though we know that 38 certainly is not in a finite cycle of A019565, because A048675(38) = 129, A048675(129) = 8194 and A048675(8194) = 4503599627370561 which factorizes as 3^2 * 37 * 71 * 190483425427 (thus is not squarefree and A285320(38) = 3), the value of a(38) is most likely so huge that it will not fit into the data section or even into a b-file. The same problem applies to all numbers that share prime factors with 38, namely 76, 152, 304, 608, 722, ...
Terms a(39) .. a(61) are [632, 51, 8190, 60, 16382, 505, 17, 72057594037927932, 32766, 159, 29, 103, 1016, 153, 65534, 319, 50, 43, 16376, 131014, 131070, 57, 262142].
The name is slightly misleading. The given definition of a(n) is not always very helpful to compute the terms (cf. example of n = 38), it is actually not clear whether the sequence is well defined. - M. F. Hasler, Mar 01 2018

Examples

			a(1) = 0 and a(2) = 1 by definition.
a(3) = a(prime(2)) = a(A019565(2^1)) = 2*a(2) = 2.
a(4) = a(2^2) = a(A065642(2)) = 1 + 2*a(2) = 3.
a(5) = a(prime(3)) = a(A019565(2^2)) = 2*a(4) = 6.
a(9) = a(3^2) = a(A065642(3)) = 1 + 2*a(3) = 5.
a(10) = a(2*5) = a(prime(1)*prime(3)) = a(A019565(2^0+2^2)) = 2*a(1+4) = 12.
To compute a(38), write 38 = prime(1)*prime(8) = A019565(2^7+2^0), so a(38) = 2*a(129). To compute this, use 129 = prime(2)*prime(14) = A019565(2^13+2^1), so a(129) = 2*a(8194). But 8194 = prime(1)*prime(7)*prime(53) = A019565(2^0+2^6+2^52), so a(8194) = 2*a(4503599627370561)...
		

Crossrefs

Inverse: A285332.
Compare also to permutation A285111.

Programs

Formula

a(1) = 0, a(2) = 1, and for n > 2, if A008683(n) <> 0 [when n is squarefree], a(n) = 2*a(A048675(n)), otherwise a(n) = 1 + 2*a(A285328(n)).
For all n >= 0, a(A285332(n)) = n.

A285333 a(n) = A048675(A285332(n)).

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 4, 3, 6, 4, 9, 6, 5, 8, 8, 4, 15, 8, 12, 5, 14, 10, 27, 8, 10, 6, 25, 12, 7, 16, 16, 5, 210, 16, 45, 10, 35, 16, 18, 5, 105, 16, 28, 11, 462, 28, 81, 10, 21, 12, 20, 7, 154, 26, 125, 16, 30, 8, 49, 24, 11, 32, 32, 6, 10659, 212, 420, 17, 910, 46, 75, 10, 78, 36, 175, 20, 33, 20, 24, 6, 3094, 106, 315, 18, 385, 32, 56, 17, 780045
Offset: 0

Views

Author

Antti Karttunen, Apr 19 2017

Keywords

Comments

Following A285332, also this sequence can be represented in a form of a binary tree:
0
|
...................1...................
2 2
3......../ \........4 4......../ \........3
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
6 4 9 6 5 8 8 4
15 8 12 5 14 10 27 8 10 6 25 12 7 16 16 5
etc.

Crossrefs

Cf. A001477, A048675, A109162, A285325, A285330, A285332 (even bisection).

Programs

Formula

a(n) = A048675(A285332(n)).
For all n >= 1, a(2n) = A285332(n).
a(2^n) = A109162(1+n). [The left edge of the tree.]
a(A000225(n)) = n. [The right edge of tree.]

A286542 a(n) = A046523(A285332(n)).

Original entry on oeis.org

1, 2, 2, 4, 6, 4, 2, 8, 6, 12, 6, 8, 6, 4, 2, 16, 210, 12, 6, 12, 30, 12, 210, 16, 6, 12, 30, 8, 30, 4, 2, 32, 210, 420, 210, 12, 30, 12, 6, 24, 210, 60, 30, 24, 30030, 420, 30, 32, 30, 12, 6, 24, 210, 60, 30030, 16, 210, 60, 30, 8, 30, 4, 2, 64, 510510, 420, 210, 420, 30030, 420, 210, 24, 210, 60, 30030, 12, 6, 12, 6, 36, 2310, 420
Offset: 0

Views

Author

Antti Karttunen, May 17 2017

Keywords

Crossrefs

Cf. A000120, A002110, A046523, A285332, A286543 (rgs-version of this sequence).

Programs

Formula

a(n) = A046523(A285332(n)).
Other identities.
For all n >= 1, a(2n) = A002110(A000120(A285332(n))).

A019565 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.

Original entry on oeis.org

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

Views

Author

Keywords

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

Examples

			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)
		

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.

Programs

  • Haskell
    a019565 n = product $ zipWith (^) a000040_list (a030308_row n)
    -- Reinhard Zumkeller, Apr 27 2013
    
  • 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 *)
  • 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
    
  • 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

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)

Extensions

Definition corrected by Klaus-R. Löffler, Aug 20 2014
New name from Peter Munn, Jun 14 2020

A087207 A binary representation of the primes that divide a number, shown in decimal.

Original entry on oeis.org

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

Views

Author

Mitch Cervinka (puritan(AT)planetkc.com), Oct 26 2003

Keywords

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

Examples

			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.
		

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

Programs

  • Haskell
    a087207 = sum . map ((2 ^) . (subtract 1) . a049084) . a027748_row
    -- Reinhard Zumkeller, Jul 16 2013
    
  • 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 *)
  • 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<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

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)

Extensions

More terms from Don Reble, Ray Chandler and Naohiro Nomoto, Oct 28 2003
Name clarified by Antti Karttunen, Jun 18 2017

A065642 a(1) = 1; for n > 1, a(n) = Min {m > n | m has same prime factors as n ignoring multiplicity}.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Dec 03 2001

Keywords

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.

Examples

			a(10) = a(2 * 5) = 2 * 2 * 5 = 20; a(12) = a(2^2 * 3) = 2 * 3^2 = 18.
		

Crossrefs

Cf. A285328 (a left inverse).
Cf. also arrays A284457 & A284311, A285321 and permutations A284572, A285112, A285332.

Programs

  • 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
    
  • 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 *)
  • 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(tn, mn=t)); mn \\ Charles R Greathouse IV, Oct 18 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
  • 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
    

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

A285330 If n is squarefree, then a(n) = A048675(n), otherwise a(n) = A285328(n).

Original entry on oeis.org

0, 1, 2, 2, 4, 3, 8, 4, 3, 5, 16, 6, 32, 9, 6, 8, 64, 12, 128, 10, 10, 17, 256, 18, 5, 33, 9, 14, 512, 7, 1024, 16, 18, 65, 12, 24, 2048, 129, 34, 20, 4096, 11, 8192, 22, 15, 257, 16384, 36, 7, 40, 66, 26, 32768, 48, 20, 28, 130, 513, 65536, 30, 131072, 1025, 21, 32, 36, 19, 262144, 34, 258, 13, 524288, 54, 1048576, 2049, 45, 38, 24, 35, 2097152, 50, 27
Offset: 1

Views

Author

Antti Karttunen, Apr 19 2017

Keywords

Comments

Each n > 1 occurs exactly twice in this sequence. a(n) tells which number is located at the parent node of the node that contains n in the binary tree A285332. See further comments there.

Crossrefs

Programs

  • Mathematica
    Table[Which[n == 1, 0, MoebiusMu@ n != 0, Total@ Map[#2*2^(PrimePi@ #1 - 1) & @@ # &, FactorInteger[n]], True, With[{r = DivisorSum[n, EulerPhi[#] Abs@ MoebiusMu[#] &]}, SelectFirst[Range[n - 2, 2, -1], DivisorSum[#, EulerPhi[#] Abs@ MoebiusMu[#] &] == r &]]], {n, 81}] (* Michael De Vlieger, Dec 31 2018 *)
  • PARI
    A007947(n) = factorback(factorint(n)[, 1]); \\ From Andrew Lelechenko, May 09 2014
    A048675(n) = my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; \\ Michel Marcus, Oct 10 2016
    A285328(n) = { my(r); if((n > 1 && !bitand(n,(n-1))), (n/2), r=A007947(n); if(r==n,1,n = n-r; while(A007947(n) <> r, n = n-r); n)); };
    A285330(n) = if(moebius(n)<>0,A048675(n),A285328(n));
    
  • Scheme
    (define (A285330 n) (if (not (zero? (A008683 n))) (A048675 n) (A285328 n)))

Formula

If A008683(n) <> 0 [when n is squarefree], a(n) = A048675(n), otherwise a(n) = A285328(n).

A285321 Square array A(1,k) = A019565(k), A(n,k) = A065642(A(n-1,k)), read by descending antidiagonals.

Original entry on oeis.org

2, 3, 4, 6, 9, 8, 5, 12, 27, 16, 10, 25, 18, 81, 32, 15, 20, 125, 24, 243, 64, 30, 45, 40, 625, 36, 729, 128, 7, 60, 75, 50, 3125, 48, 2187, 256, 14, 49, 90, 135, 80, 15625, 54, 6561, 512, 21, 28, 343, 120, 225, 100, 78125, 72, 19683, 1024
Offset: 1

Views

Author

Antti Karttunen, Apr 17 2017

Keywords

Comments

A permutation of the natural numbers > 1.
Otherwise like array A284311, but the columns come in different order.

Examples

			The top left 12x6 corner of the array:
   2,   3,  6,     5,  10,  15,  30,      7,  14,  21,  42,   35
   4,   9, 12,    25,  20,  45,  60,     49,  28,  63,  84,  175
   8,  27, 18,   125,  40,  75,  90,    343,  56, 147, 126,  245
  16,  81, 24,   625,  50, 135, 120,   2401,  98, 189, 168,  875
  32, 243, 36,  3125,  80, 225, 150,  16807, 112, 441, 252, 1225
  64, 729, 48, 15625, 100, 375, 180, 117649, 196, 567, 294, 1715
		

Crossrefs

Transpose: A285322.
Cf. A008479 (index of the row where n is located), A087207 (of the column).
Cf. arrays A284311, A285325, also A285332.

Programs

  • Mathematica
    a065642[n_] := Module[{k}, If[n == 1, Return[1], k = n + 1; While[ EulerPhi[k]/k != EulerPhi[n]/n, k++]]; k];
    A[1, k_] := Times @@ Prime[Flatten[Position[#, 1]]]&[Reverse[ IntegerDigits[k, 2]]];
    A[n_ /; n > 1, k_] := A[n, k] = a065642[A[n - 1, k]];
    Table[A[n - k + 1, k], {n, 1, 10}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Nov 17 2019 *)
  • 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(k, n - k + 1) for k in range(1, n + 1)]) # Indranil Ghosh, Apr 18 2017
  • Scheme
    (define (A285321 n) (A285321bi (A002260 n) (A004736 n)))
    (define (A285321bi row col) (if (= 1 row) (A019565 col) (A065642 (A285321bi (- row 1) col))))
    

Formula

A(1,k) = A019565(k), A(n,k) = A065642(A(n-1,k)).
For all n >= 2: A(A008479(n), A087207(n)) = n.

A285319 Squarefree numbers n for which A019565(n) < n and A048675(n) is also squarefree.

Original entry on oeis.org

66, 129, 130, 258, 514, 1034, 1041, 1042, 2049, 2054, 2055, 2066, 2082, 2114, 4098, 4101, 4102, 4130, 4161, 4162, 4226, 4353, 4354, 4610, 5122, 8193, 8198, 8202, 8205, 8206, 8210, 8211, 8229, 8259, 8706, 9218, 9219, 12291
Offset: 1

Views

Author

Antti Karttunen, Apr 18 2017

Keywords

Comments

Any finite cycle in A019565, if such cycles exist at all, must have at least one member that occurs somewhere in this sequence. Furthermore, such a number n should satisfy A019565(n) < n and that A048675(n)^k is squarefree for all k >= 0.

Crossrefs

Subsequence of A285317.
Cf. also A285320 and discussion in A285331 and A285332.

Programs

  • Mathematica
    lim = 4000;
    A019565 = Table[Times @@ Prime@Flatten@Position[#, 1] &@
       Reverse@IntegerDigits[n, 2], {n, 1, lim}]; (* From Michael De Vlieger in A019565 *)
    A048675 = Table[Total[#[[2]]*2^(PrimePi[#[[1]]] - 1) & /@ FactorInteger[n]], {n, 1, lim}]; (* From Jean-François Alcover in A048675 *)
    Select[Range[lim], A019565[[#]] < # && SquareFreeQ[#] &&
    SquareFreeQ[A048675[[#]]] &] (* Robert Price, Apr 07 2019 *)
  • PARI
    allocatemem(2^30);
    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
    A048675(n) = my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; \\ Michel Marcus, Oct 10 2016
    isA285319(n) = (issquarefree(n) & (A019565(n) < n) && issquarefree(A048675(n)));
    n=0; k=0; while(k <= 60, n=n+1; if(isA285319(n),print1(n,", ");k=k+1));
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A285319 (MATCHING-POS 1 0 (lambda (n) (and (< (A019565 n) n) (not (zero? (A008683 n))) (not (zero? (A008683 (A048675 n))))))))

A109162 a(1) = 1; for n > 1, a(n) = A019565(a(n-1)).

Original entry on oeis.org

1, 2, 3, 6, 15, 210, 10659, 54230826, 249853434654335387610276087
Offset: 1

Views

Author

Leroy Quet, Aug 18 2005

Keywords

Comments

After the initial 1, even-indexed terms are of the form 4k+2 (members of A016825) and odd-indexed terms are of the form 6k+3 (members of A016945). However, not all even terms after 2 are multiples of three, because not all odd-indexed terms are of the form 4k+3. For example, because a(11) is of the form 4k+1, a(12) cannot be a multiple of three. - Antti Karttunen, Jun 18 2017

Examples

			a(4) = 6, which is 110 in binary. So a(5) is the product of the primes corresponding to the 1's of 110, 3*5 = 15.
		

Crossrefs

Cf. A019565, A285320 (a left inverse).
The left edge of A285332 and A285333.
Cf. A153013, A328316 for similar iteration sequences, and also A376406, A376407, A376408.

Programs

  • Mathematica
    NestList[Times @@ Prime@ Flatten@ Position[#, 1] &@ Reverse@ IntegerDigits[#, 2] &, 1, 11] (* Michael De Vlieger, Aug 20 2017 *)

Extensions

More terms from Franklin T. Adams-Watters, Aug 29 2006
Showing 1-10 of 17 results. Next