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-6 of 6 results.

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

A054842 If n = a + 10 * b + 100 * c + 1000 * d + ... then a(n) = (2^a) * (3^b) * (5^c) * (7^d) * ...

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 3, 6, 12, 24, 48, 96, 192, 384, 768, 1536, 9, 18, 36, 72, 144, 288, 576, 1152, 2304, 4608, 27, 54, 108, 216, 432, 864, 1728, 3456, 6912, 13824, 81, 162, 324, 648, 1296, 2592, 5184, 10368, 20736, 41472, 243, 486, 972, 1944
Offset: 0

Views

Author

Henry Bottomley, Apr 11 2000

Keywords

Comments

a((10^k-1)/9) = Primorial(k)= A061509((10^k-1)/9). This is a rearrangement of whole numbers. a(m) = a(n) iff m = n. (Unlike A061509, in which a(n) = a(n*10^k).) - Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jul 14 2003
Part of the previous comment is incorrect: as a set, this sequence consists of numbers n such that the largest exponent appearing in the prime factorization of n is 9. So this cannot be a rearrangement (or permutation) of the natural numbers. - Tom Edgar, Oct 20 2015

Examples

			a(15)=96 because 3^1 * 2^5 = 3*32 = 96.
		

Crossrefs

Cf. analogous sequences for other bases: A019565 (base 2), A101278 (base 3), A101942 (base 4), A101943 (base 5), A276076 (factorial base), A276086 (primorial base).

Programs

  • Haskell
    a054842 = f a000040_list 1 where
       f _      y 0 = y
       f (p:ps) y x = f ps (y * p ^ d) x'  where (x', d) = divMod x 10
    -- Reinhard Zumkeller, Aug 03 2015
    
  • Mathematica
    A054842[n_] := Times @@ (Prime[Range[Length[#], 1, -1]]^#) & [IntegerDigits[n]];
    Array[A054842, 100, 0] (* Paolo Xausa, Nov 25 2024 *)
  • PARI
    a(n)= my(d=Vecrev(digits(n))); factorback(primes(#d), d); \\ Ruud H.G. van Tol, Nov 28 2024

Formula

a(n) = f(n, 1, 1) with f(x, y, z) = if x > 0 then f(floor(x/10), y*prime(z)^(x mod 10), z+1) else y. - Reinhard Zumkeller, Mar 13 2010

A101942 Write n in base 4 as n = b_0 + b_1*4 + b_2*4^2 + b_3*4^3 + ...; then a(n) = Product_{i >= 0} prime(i+1)^b_i.

Original entry on oeis.org

1, 2, 4, 8, 3, 6, 12, 24, 9, 18, 36, 72, 27, 54, 108, 216, 5, 10, 20, 40, 15, 30, 60, 120, 45, 90, 180, 360, 135, 270, 540, 1080, 25, 50, 100, 200, 75, 150, 300, 600, 225, 450, 900, 1800, 675, 1350, 2700, 5400, 125, 250, 500, 1000, 375, 750, 1500, 3000, 1125
Offset: 0

Views

Author

Orges Leka (oleka(AT)students.uni-mainz.de), Dec 21 2004

Keywords

Examples

			a(13) = a(1 + 3*4) = 2^1 * 3^3 = 54.
a(29) = a(1 + 3*4 + 1*4^2) = 2^1 * 3^3 * 5^1 = 270.
		

Crossrefs

Cf. A019565 (base 2), A101278 (base 3), A101943 (base 5), A054842 (base 10).

Programs

  • Maple
    a:= n-> (l-> mul(ithprime(i)^l[i], i=1..nops(l)))(convert(n, base, 4)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Aug 31 2024
  • Mathematica
    f[n_Integer, base_Integer] /; base >= 2 := Product[ Prime[i]^IntegerDigits[n, base][[Length[IntegerDigits[n, base]] + 1 - i]], {i, Length[IntegerDigits[n, base]]}] Table[f[i, 4], {i, 0, 45}]
  • PARI
    f(n, b) = { my(d = digits(n,b), L = #d); prod(i=1, L, prime(i)^d[L+1-i]) }
    apply(n -> f(n, 4), [0..45]) \\ Satish Bysany, Mar 07 2017

Formula

a(4^k) = prime(k+1).

A101943 Write n in base 5 as n = b_0 + b_1*5 + b_2*5^2 + b_3*5^3 + ...; then a(n) = Product_{i >= 0} prime(i+1)^b_i.

Original entry on oeis.org

1, 2, 4, 8, 16, 3, 6, 12, 24, 48, 9, 18, 36, 72, 144, 27, 54, 108, 216, 432, 81, 162, 324, 648, 1296, 5, 10, 20, 40, 80, 15, 30, 60, 120, 240, 45, 90, 180, 360, 720, 135, 270, 540, 1080, 2160, 405, 810, 1620, 3240, 6480, 25, 50, 100, 200, 400, 75, 150, 300, 600
Offset: 0

Views

Author

Orges Leka (oleka(AT)students.uni-mainz.de), Dec 21 2004

Keywords

Examples

			a(29) = a(4 + 0*5 + 1*5^2) = 2^4 * 3^0 * 5^1 = 80.
		

Crossrefs

Cf. A019565 (base 2), A101278 (base 3), A101942 (base 4), A054842 (base 10).

Programs

  • Maple
    a:= n-> (l-> mul(ithprime(i)^l[i], i=1..nops(l)))(convert(n, base, 5)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Aug 31 2024
  • Mathematica
    f[n_Integer, base_Integer] /; base >= 2 := Product[ Prime[i]^IntegerDigits[n, base][[Length[IntegerDigits[n, base]] + 1 - i]], {i, Length[IntegerDigits[n, base]]}] Table[f[i, 5], {i, 0, 45}]
  • PARI
    f(n, b) = { my(d = digits(n,b), L = #d); prod(i=1, L, prime(i)^d[L+1-i]) }
    apply(n -> f(n, 5), [0..45]) \\ Satish Bysany, Mar 07 2017

A262478 a(n) = Sum_{i >= 0} d_i(n) * p_(i + 1) where d_i(n) = i-th digit of n in base 3, and p_i = i-th prime.

Original entry on oeis.org

0, 2, 4, 3, 5, 7, 6, 8, 10, 5, 7, 9, 8, 10, 12, 11, 13, 15, 10, 12, 14, 13, 15, 17, 16, 18, 20, 7, 9, 11, 10, 12, 14, 13, 15, 17, 12, 14, 16, 15, 17, 19, 18, 20, 22, 17, 19, 21, 20, 22, 24, 23, 25, 27, 14, 16, 18, 17, 19, 21, 20, 22, 24, 19, 21, 23, 22, 24, 26, 25, 27, 29, 24, 26, 28, 27
Offset: 0

Views

Author

James Burling, Sep 23 2015

Keywords

Comments

d_i(n) can be found using either of the following formulas:
* d_i(n) = floor(n / 3^i) mod 3;
* d_i(n) = floor(n / 3^i) - 3 * floor(n / 3^(i + 1)).

Examples

			The base 3 representation of n = 5 is 12 so a(5) = 2 * 2 + 1 * 3 = 7.
The base 3 representation of n = 12 is 110 so a(12) = 0 * 2 + 1 * 3 + 1 * 5 = 8.
		

Crossrefs

Similar method, different base for n: A089625 (base 2).
Similar method, uses product for sum index for multiplication: A019565 (base 2), A101278 (base 3), A054842 (base 10).

Programs

  • Mathematica
    Table[Sum[IntegerDigits[n, 3][[-i]] Prime@ i, {i, IntegerLength[n, 3]}], {n, 0, 81}] (* Michael De Vlieger, Sep 24 2015 *)
  • PARI
    a(n) = my(d = Vecrev(digits(n, 3))); sum(k=1, #d, d[k]*prime(k)); \\ Michel Marcus, Sep 24 2015

Formula

a(n) = Sum_{i >= 0} p_(i + 1) * (floor(n / 3^i) - 3 * floor(n / 3^(i + 1))).

A263042 a(n) = Sum_{i >= 1} d_i(n) * prime(i) where d_i(n) is the i-th digit of n in base 10, and prime(i) is the i-th prime.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36
Offset: 0

Views

Author

James Burling, Oct 08 2015

Keywords

Comments

Digits are counted from the right, so d_1(n) is the ones digit, d_2(n) is the tens digit, etc.
d_i(n) can be found using either of the following formulas:
* d_i(n) = floor(n / 10^(i-1)) mod 10;
* d_i(n) = floor(n / 10^(i-1)) - 10 * floor(n / 10^i).
From Derek Orr, Dec 24 2015: (Start)
For n < 1000, this sequence may be written as a series of 10 X 10 subtables:
Subtable 1:
0, 2, 4, 6, 8, 10, 12, 14, 16, 18
3, 5, 7, 9, 11, 13, 15, 17, 19, 21
6, 8, 10, 12, 14, 16, 18, 20, 22, 24
9, 11, 13, 15, 17, 19, 21, 23, 25, 27
12, 14, 16, 18, 20, 22, 24, 26, 28, 30
15, 17, 19, 21, 23, 25, 27, 29, 31, 33
18, 20, 22, 24, 26, 28, 30, 32, 34, 36
21, 23, 25, 27, 29, 31, 33, 35, 37, 39
24, 26, 28, 30, 32, 34, 36, 38, 40, 42
27, 29, 31, 33, 35, 37, 39, 41, 43, 45
Subtable 2:
5, 7, 9, 11, 13, 15, 17, 19, 21, 23
8, 10, 12, 14, 16, 18, 20, 22, 24, 26
11, 13, 15, 17, 19, 21, 23, 25, 27, 29
14, 16, 18, 20, 22, 24, 26, 28, 30, 32
17, 19, 21, 23, 25, 27, 29, 31, 33, 35
20, 22, 24, 26, 28, 30, 32, 34, 36, 38
23, 25, 27, 29, 31, 33, 35, 37, 39, 41
26, 28, 30, 32, 34, 36, 38, 40, 42, 44
29, 31, 33, 35, 37, 39, 41, 43, 45, 47
32, 34, 36, 38, 40, 42, 44, 46, 48, 50
Subtable 3:
10, 12, 14, 16, 18, 20, 22, 24, 26, 28
13, 15, 17, 19, 21, 23, 25, 27, 29, 31
16, 18, 20, 22, 24, 26, 28, 30, 32, 34
19, 21, 23, 25, 27, 29, 31, 33, 35, 37
22, 24, 26, 28, 30, 32, 34, 36, 38, 40
25, 27, 29, 31, 33, 35, 37, 39, 41, 43
28, 30, 32, 34, 36, 38, 40, 42, 44, 46
31, 33, 35, 37, 39, 41, 43, 45, 47, 49
34, 36, 38, 40, 42, 44, 46, 48, 50, 52
37, 39, 41, 43, 45, 47, 49, 51, 53, 55
...
Each subtable is 10 X 10. Let T_n(j,k) = the element in the j-th row of the k-th column of subtable n. T_n(1,1) = 5*(n-1). T_n(j,1) = 5*(n-1)+3*(j-1). T_n(1,k) = 5*(n-1)+2*(k-1). Altogether, T_n(j,k) = 5*(n-1)+3*(j-1)+2*(k-1) = 5*n+3*j+2*k-10.
(End)

Examples

			For n = 12, the digits are 2 and 1 and the corresponding primes are 2 and 3, so a(12) = (first digit * first prime) + (second digit * second prime) = 2 * 2 + 1 * 3 = 4 + 3 = 7.
		

Crossrefs

Similar method, different base for n: A089625 (base 2), A262478 (base 3).
Similar method, uses product instead of sum: A019565 (base 2), A101278 (base 3), A054842 (base 10).

Programs

  • Mathematica
    Table[Sum_{m=0}^{infinity} (Floor[n/10^(m)] - 10*Floor[n/10^(m+1)])*Prime(m+1), {n,0,500}] (* G. C. Greubel, Oct 08 2015 *)
  • PARI
    a(n) = if (n==0, d = [0], d=Vecrev(digits(n))); sum(i=1,#d, d[i]*prime(i)); \\ Michel Marcus, Oct 10 2015
    
  • PARI
    vector(200,n,n--;sum(i=1,#digits(n),Vecrev(digits(n))[i]*prime(i))) \\ Derek Orr, Dec 24 2015

Formula

a(n) = Sum_{i >= 0} prime(i + 1) * (floor(n / 10^i) - 10 * floor(n / 10^(i + 1))).
Showing 1-6 of 6 results.