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.

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

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

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 2, 0, -2, 0, 4, 0, 12, 4, 12, 0, -6, -4, 2, 0, 14, 8, 22, 0, 24, 24, 48, 8, 96, 24, 50, 0, -20, -12, -2, -8, 18, 4, 24, 0, 36, 28, 62, 16, 130, 44, 88, 0, 72, 48, 96, 48, 192, 96, 170, 16, 286, 192, 316, 48, 564, 100, 180, 0, -48, -40, -28, -24, -4, -4, 28, -16, 18, 36, 90, 8, 198, 48, 110, 0, 62
Offset: 1

Views

Author

Antti Karttunen, Jul 28 2023

Keywords

Comments

Compare to the scatter plot of A364563.
From Antti Karttunen, Aug 11 2023: (Start)
Can be computed as a certain kind of bitmask transformation of A364568 (analogous to the inverse Möbius transform that is appropriate for A156552-encoding of n).
See A364572, A364573 (and also A364576) for n (apart from those in A029747) where a(n) comes relatively close to the X-axis.
(End)

Examples

			A005940(528577) = 528581, therefore a(528577) = 528581 - 528577 = 4. (See A364576).
A005940(2109697) = 2109629, therefore a(2109697) = 2109629 - 2109697 = -68.
		

Crossrefs

Cf. A005940, A364500 [= gcd(n,a(n))], A364559, A364572, A364573, A364576.
Cf. A029747 (known positions of 0's), A364540 (positions of terms < 0), A364541 (of terms <= 0), A364542 (of terms >= 0), A364563 [= -a(A364543(n))].
Cf. also A364258, A364568.

Programs

  • Mathematica
    nn = 81; 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[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 };
    A364499(n) = (A005940(n)-n);
    
  • PARI
    A364499(n) = { my(m=1,p=2,x=0,z=1); n--; while(n, if(!(n%2), p=nextprime(1+p), x += m; z *= p); n>>=1; m <<=1); (z-x)-1; }; \\ Antti Karttunen, Aug 06 2023
    
  • Python
    from math import prod
    from itertools import accumulate
    from collections import Counter
    from sympy import prime
    def A364499(n): return prod(prime(len(a)+1)**b for a, b in Counter(accumulate(bin(n-1)[2:].split('1')[:0:-1])).items())-n # Chai Wah Wu, Aug 07 2023

Formula

a(n) = -A364559(A005940(n)).
For all n >= 1, a(2*n) = 2*a(n).
For all n >= 1, a(A029747(n)) = 0.

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

A364561 Odd numbers k for which A156552(k) < k.

Original entry on oeis.org

1, 3, 5, 9, 15, 21, 25, 27, 35, 45, 49, 55, 63, 75, 77, 81, 91, 99, 105, 121, 125, 135, 143, 147, 165, 169, 175, 187, 189, 195, 221, 225, 231, 243, 245, 273, 275, 289, 297, 315, 323, 325, 343, 351, 357, 363, 375, 385, 405, 425, 429, 441, 455, 495, 507, 525, 539, 561, 567, 585, 595, 605, 625, 627, 637, 663, 665
Offset: 1

Views

Author

Antti Karttunen, Jul 28 2023

Keywords

Comments

Odd numbers k such that A005941(k) <= k.

Crossrefs

Odd terms in A364560.
Cf. A005940, A005941, A156552, A364545, A364564 (largest prime factor).
Cf. also A364551, A364576 (subsequences).

Programs

  • PARI
    A156552(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]); res };
    isA364561(n) = ((n%2)&&(A156552(n) < n));

A364572 Starting from k=7, each subsequent term is the next larger odd k such that A005940(k) >= k and the ratio A005940(k)/k is nearer to 1.0 than for any previous k in the sequence.

Original entry on oeis.org

7, 19, 321, 139307, 262365, 264245, 528577
Offset: 1

Views

Author

Antti Karttunen, Aug 06 2023

Keywords

Examples

			     k   A005940(k)   A005940(k)/k  A005940(k)-k
     7         9      1.285714286        2
    19        21      1.105263158        2
   321       323      1.006230530        2
139307    139965      1.004723381      658
262365    263375      1.003849599     1010
264245    264845      1.002270620      600
528577    528581      1.000007567        4.
		

Crossrefs

Cf. A005940.
Cf. also A364573, A364576.

Programs

  • PARI
    print1(7,", "); r = A005940(7)/7; forstep(n=7,1+(2^26),2,t=A005940(n)/n; if(t>=1 && t < r, r=t;print1(n, ", ")))

A364573 Starting from k=9, each subsequent term is the next larger odd k such that A005940(k) <= k and the ratio A005940(k)/k is nearer to 1.0 than for any previous k in the sequence.

Original entry on oeis.org

9, 35, 267, 8353, 16475, 16543, 132175, 262563, 295175, 1115151, 2098057, 2109697, 8651313, 537938015, 1073787425
Offset: 1

Views

Author

Antti Karttunen, Aug 06 2023

Keywords

Examples

			           k     A005940(k)  A005940(k)/k  k-A005940(k)
           9             7    0.7777778          2
          35            33    0.9428571          2
         267           255    0.9550562         12
        8353          8177    0.9789297        176
       16475         16275    0.9878604        200
       16543         16443    0.9939551        100
      132175        131733    0.9966560        442
      262563        262119    0.9983090        444
      295175        294831    0.9988346        344
     1115151       1114749    0.9996395        402
     2098057       2097851    0.9999018        206
     2109697       2109629    0.9999678         68
     8651313       8651137    0.9999797        176
   537938015     537931935    0.9999887       6080
  1073787425    1073785843    0.9999985       1582.
		

Crossrefs

Programs

  • PARI
    print1(9,", "); r = A005940(9)/9; forstep(n=9,1+(2^31),2,t=A005940(n)/n; if(t<=1 && t > r, r=t;print1(n, ", ")))
Showing 1-6 of 6 results.