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 10 results.

A029747 Numbers of the form 2^k times 1, 3 or 5.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96, 128, 160, 192, 256, 320, 384, 512, 640, 768, 1024, 1280, 1536, 2048, 2560, 3072, 4096, 5120, 6144, 8192, 10240, 12288, 16384, 20480, 24576, 32768, 40960, 49152, 65536, 81920, 98304, 131072, 163840, 196608
Offset: 1

Views

Author

Keywords

Comments

Fixed points of the Doudna sequence: A005940(a(n)) = A005941(a(n)) = a(n). - Reinhard Zumkeller, Aug 23 2006
Subsequence of A103969. - R. J. Mathar, Mar 06 2010
Question: Is there a simple proof that A005940(c) = c would never allow an odd composite c as a solution? See also my comments in A163511 and in A335431 concerning similar problems, also A364551 and A364576. - Antti Karttunen, Jul 28 & Aug 11 2023

Examples

			128 = 2^7 * 1 is in the sequence as well as 160 = 2^5 * 5. - _David A. Corneth_, Sep 18 2020
		

Crossrefs

Subsequence of the following sequences: A103969, A253789, A364541, A364542, A364544, A364546, A364548, A364550, A364560, A364565.
Even terms form a subsequence of A320674.

Programs

  • Mathematica
    m = 200000; Select[Union @ Flatten @ Outer[Times, {1, 3, 5}, 2^Range[0, Floor[Log2[m]]]], # < m &] (* Amiram Eldar, Oct 15 2020 *)
  • PARI
    is(n) = n>>valuation(n, 2) <= 5 \\ David A. Corneth, Sep 18 2020
    
  • Python
    def A029747(n):
        if n<3: return n
        a, b = divmod(n,3)
        return 1<Chai Wah Wu, Apr 02 2025

Formula

a(n) = if n < 6 then n else 2*a(n-3). - Reinhard Zumkeller, Aug 23 2006
G.f.: (1+x+x^2)^2/(1-2*x^3). - R. J. Mathar, Mar 06 2010
Sum_{n>=1} 1/a(n) = 46/15. - Amiram Eldar, Oct 15 2020

Extensions

Edited by David A. Corneth and Peter Munn, Sep 18 2020

A364500 a(n) = gcd(n, A005940(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 1, 8, 1, 10, 1, 12, 1, 2, 3, 16, 1, 2, 1, 20, 7, 2, 1, 24, 1, 2, 3, 4, 1, 6, 1, 32, 1, 2, 1, 4, 1, 2, 3, 40, 1, 14, 1, 4, 5, 2, 1, 48, 1, 2, 3, 4, 1, 6, 5, 8, 1, 2, 1, 12, 1, 2, 9, 64, 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 15, 4, 11, 6, 1, 80, 1, 2, 1, 28, 5, 2, 3, 8, 1, 10, 7, 4, 1, 2, 5, 96, 1, 2, 33, 4
Offset: 1

Views

Author

Antti Karttunen, Jul 28 2023

Keywords

Crossrefs

Programs

  • Mathematica
    nn = 100; Array[Set[a[#], #] &, 2]; Do[If[EvenQ[n], Set[a[n], 2 a[n/2]], Set[a[n], Times @@ Power @@@ Map[{Prime[PrimePi[#1] + 1], #2} & @@ # &, FactorInteger[a[(n + 1)/2]]]]], {n, 3, nn}]; Array[GCD[a[#], #] &, nn] (* Michael De Vlieger, Jul 28 2023 *)
  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    A364500(n) = gcd(n, A005940(n));
    
  • PARI
    A364500(n) = { my(orgn=n,p=2,rl=0,z=1); n--; while(n, if(!(n%2), p=nextprime(1+p), rl++; if(1==(n%4), z *= p^min(rl,valuation(orgn,p)); rl=0)); n>>=1); (z); };

Formula

a(n) = gcd(n, A364499(n)) = gcd(A005940(n), A364499(n)).
a(n) = n / A364501(n) = A005940(n) / A364502(n).

A364542 Numbers k for which A005940(k) >= k.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 71, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95
Offset: 1

Views

Author

Antti Karttunen, Jul 28 2023

Keywords

Comments

Sequence A005941(A364560(.)) sorted into ascending order.
A029747 is included as a subsequence, because it gives the known fixed points of map n -> A005940(n).
Differs from A343107 for the first time at a(22) = 25, which term is not present in A343107. On the other hand, 35 is the first term of A343107 that is not present in this sequence.

Crossrefs

Positions of nonnegative terms in A364499.
Complement of A364540.
Cf. A005940, A005941, A029747 (subsequence), A343107 (not a subsequence), A364560.

Programs

  • Mathematica
    nn = 95; Array[Set[a[#], #] &, 2]; Do[If[EvenQ[n], Set[a[n], 2 a[n/2]], Set[a[n], Times @@ Power @@@ Map[{Prime[PrimePi[#1] + 1], #2} & @@ # &, FactorInteger[a[(n + 1)/2]]]]], {n, 3, nn}]; Select[Range[nn], a[#] >= # &] (* Michael De Vlieger, Jul 28 2023 *)
  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    isA364542(n) = (A005940(n)>=n);

A364559 a(n) = A005941(n) - n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 2, 0, -2, 0, 6, 0, 20, 4, -4, 0, 48, -4, 110, 0, -2, 12, 234, 0, -12, 40, -12, 8, 484, -8, 994, 0, 2, 96, -14, -8, 2012, 220, 28, 0, 4056, -4, 8150, 24, -22, 468, 16338, 0, -24, -24, 80, 80, 32716, -24, -18, 16, 202, 968, 65478, -16, 131012, 1988, -24, 0, 4, 4, 262078, 192, 446, -28, 524218, -16
Offset: 1

Views

Author

Antti Karttunen, Jul 28 2023

Keywords

Examples

			a(528581) = -4 as A005941(528581) = 528577 = 528581-4. Notably, 528581 = 17^2 * 31 * 59, with divisors [1, 17, 31, 59, 289, 527, 1003, 1829, 8959, 17051, 31093, 528581]. Applying A364557 to these divisors gives [1, 64, 1024, 65536, 128, 1024, 65536, 65536, 2048, 131072, 65536, 131072], while applying Euler totient phi (A000010) to them gives [1, 16, 30, 58, 272, 480, 928, 1740, 8160, 15776, 27840, 473280], their differences being [0, 48, 994, 65478, -144, 544, 64608, 63796, -6112, 115296, 37696, -342208], whose sum is -4.
		

Crossrefs

Cf. A005941, A364499, A364557, A364558 (Möbius transform).
Cf. A029747 (known positions of 0's), A364560 (of terms <= 0), A364562 (of terms > 0), A364576.
Cf. also A364288.

Programs

  • PARI
    A005941(n) = { my(f=factor(n), p, p2=1, res=0); for(i=1, #f~, p = 1 << (primepi(f[i, 1])-1); res += (p * p2 * (2^(f[i, 2])-1)); p2 <<= f[i, 2]); (1+res) }; \\ (After David A. Corneth's program for A156552)
    A364559(n) = (A005941(n)-n);
    
  • Python
    from sympy import factorint, primepi
    def A364559(n): return sum(1<Chai Wah Wu, Jul 29 2023

Formula

a(n) = -A364499(A005941(n)).
a(n) = Sum_{d|n} A364558(d).

A365462 a(n) = A356867(n) - n.

Original entry on oeis.org

0, 0, 0, 1, -1, 0, 3, 0, 0, -3, 3, 3, 12, 6, -3, 34, -1, 0, 16, 8, 9, 103, 17, 0, 75, 6, 0, -17, -7, -9, 24, 12, 9, 36, 21, 9, 12, 60, 36, 135, 99, 18, 207, 36, -9, 199, 149, 102, 576, 150, -3, 448, 11, 0, 22, 54, 48, 217, 29, 24, 289, 50, 27, 279, 425, 309, 808, 212, 51, 1180, 89, 0, 1152, 318, 225, 3049, 323, 18
Offset: 1

Views

Author

Antti Karttunen, Sep 15 2023

Keywords

Crossrefs

Cf. A356867, A364958 (positions of 0's), A365463.
Cf. also A364499.

Programs

  • PARI
    up_to = 19683;
    A356867list(up_to) = { my(v=vector(up_to),met=Map(),h=0,ak); for(i=1,#v,if(1==vecsum(digits(i,3)), v[i] = i; h = i, ak = v[i-h]; forprime(p=2,,if(3!=p && !mapisdefined(met,p*ak), v[i] = p*ak; break))); mapput(met,v[i],i)); (v); };
    v356867 = A356867list(up_to);
    A356867(n) = v356867[n];
    A365462(n) = (A356867(n)-n);

A364541 Numbers k for which A005940(k) <= k.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 16, 17, 18, 20, 24, 32, 33, 34, 35, 36, 40, 48, 64, 65, 66, 67, 68, 69, 70, 72, 80, 96, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 140, 144, 160, 192, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 270, 272, 273, 274, 276, 280, 288, 289, 320, 384, 385, 512
Offset: 1

Views

Author

Antti Karttunen, Jul 28 2023

Keywords

Comments

A029747 is included as a subsequence, because it gives the known fixed points of map n -> A005940(n).

Crossrefs

Positions of nonpositive terms in A364499.
Subsequences: A029747, A364540.

Programs

  • Mathematica
    nn = 512; Array[Set[a[#], #] &, 2]; Do[If[EvenQ[n], Set[a[n], 2 a[n/2]], Set[a[n], Times @@ Power @@@ Map[{Prime[PrimePi[#1] + 1], #2} & @@ # &, FactorInteger[a[(n + 1)/2]]]]], {n, 3, nn}]; Select[Range[nn], a[#] <= # &] (* Michael De Vlieger, Jul 28 2023 *)
  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    isA364541(n) = (A005940(n)<=n);

A364563 Difference k - A005940(k) computed for those odd numbers k for which the difference is nonnegative.

Original entry on oeis.org

0, 0, 0, 2, 6, 20, 2, 48, 28, 4, 110, 80, 48, 18, 18, 234, 202, 166, 110, 132, 12, 64, 42, 24, 484, 446, 402, 348, 360, 238, 50, 68, 276, 132, 246, 186, 204, 240, 994, 940, 884, 824, 830, 690, 462, 526, 722, 560, 240, 192, 680, 300, 596, 194, 602, 614, 696, 2012, 1958, 1898, 1794, 1840, 1624, 1336, 1442, 1724, 1458
Offset: 1

Views

Author

Antti Karttunen, Aug 06 2023

Keywords

Crossrefs

Cf. also A364294.

Formula

a(n) = -A364499(A364543(n)).

A364568 a(n) = A290077(n) - A364567(n).

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 2, 0, -2, 0, 4, 0, 12, 2, 10, 0, -6, -2, 4, 0, 16, 4, 16, 0, 26, 12, 32, 4, 84, 10, 38, 0, -20, -6, 4, -4, 24, 4, 20, 0, 44, 16, 40, 8, 104, 16, 56, 0, 78, 26, 68, 24, 152, 32, 104, 8, 262, 84, 184, 20, 468, 38, 130, 0, -48, -20, -8, -12, 16, 4, 28, -8, 40, 24, 64, 8, 168, 20, 76, 0, 88, 44, 104, 32
Offset: 0

Views

Author

Antti Karttunen, Aug 05 2023

Keywords

Crossrefs

Programs

  • PARI
    A290077(n) = { my(p=2,z=1); while(n, if(!(n%2), p=nextprime(1+p), z *= (p-(1==(n%4)))); n>>=1); (z); };
    A364567(n) = if(!n,n, my(i=1); while(n>1, if((n%4)!=1, i<<=1); n >>= 1); (i));
    A364568(n) = (A290077(n) - A364567(n));

Formula

For n > 0, a(n) = -A364558(A005940(1+n)) = A000010(A005940(1+n)) - 2^A033265(n).

A364540 Numbers k for which A005940(k) < k.

Original entry on oeis.org

9, 17, 18, 33, 34, 35, 36, 65, 66, 67, 68, 69, 70, 72, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 140, 144, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 270, 272, 273, 274, 276, 280, 288, 289, 385, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531
Offset: 1

Views

Author

Antti Karttunen, Jul 28 2023

Keywords

Crossrefs

Positions of negative terms in A364499.
One more than A356450.
Subsequence of A364541, complement of A364542.
Cf. A005940.

Programs

  • Mathematica
    nn = 540; Array[Set[a[#], #] &, 2]; Do[If[EvenQ[n], Set[a[n], 2 a[n/2]], Set[a[n], Times @@ Power @@@ Map[{Prime[PrimePi[#1] + 1], #2} & @@ # &, FactorInteger[a[(n + 1)/2]]]]], {n, 3, nn}]; Select[Range[nn], a[#] < # &] (* Michael De Vlieger, Jul 28 2023 *)
  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    isA364540(n) = (A005940(n)
    				

Formula

a(n) = 1 + A356450(n).

A364543 Odd numbers k for which A005940(k) <= k.

Original entry on oeis.org

1, 3, 5, 9, 17, 33, 35, 65, 67, 69, 129, 131, 133, 135, 137, 257, 259, 261, 263, 265, 267, 273, 289, 385, 513, 515, 517, 519, 521, 523, 525, 527, 529, 531, 545, 577, 641, 769, 1025, 1027, 1029, 1031, 1033, 1035, 1037, 1039, 1041, 1043, 1045, 1047, 1057, 1059, 1089, 1091, 1153, 1281, 1537, 2049, 2051, 2053, 2055
Offset: 1

Views

Author

Antti Karttunen, Aug 06 2023

Keywords

Crossrefs

Odd terms of A364541.
Cf. A005940, A364563 [= -A364499(a(n))].
Subsequences: A364547, A364573.
Cf. also A364293.

Programs

  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    isA364543(n) = ((n%2)&&(A005940(n)<=n));
Showing 1-10 of 10 results.