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

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.

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

Original entry on oeis.org

1, 3, 5, 21, 323, 66297, 139965, 263375, 264845, 528581
Offset: 1

Views

Author

Antti Karttunen, Aug 06 2023

Keywords

Comments

All the odd fixed points of map n -> A005940(n) [and its inverse, map n -> A005941(n)] are included in this sequence. This includes both the known odd fixed points, 1, 3 and 5 (see A029747), and any additional hypothetical odd composites that would satisfy the condition n == A005940(n).
This is a subsequence of A364561, so the comments given in A364564 apply also here.

Examples

			       k  A156552(k)    A156552(k)/k  k-(1+A156552(k)) factorization of k
       1:       0         0                0
       3:       2         0.6666667        0
       5:       4         0.8              0
      21:      18         0.8571429        2           (3 * 7)
     323:     320         0.9907121        2           (17 * 19)
   66297:   65714         0.9912062      582           (3 * 7^2 * 11 * 41)
  139965:  139306         0.9952917      658           (3 * 5 * 7 * 31 * 43)
  263375:  262364         0.9961614     1010           (5^3 * 7^2 * 43)
  264845:  264244         0.9977307      600           (5 * 7^2 * 23 * 47)
  528581:  528576         0.9999905        4           (17^2 * 31 * 59).
		

Crossrefs

Subsequence of A364561.
Cf. also A364551, A364564, A364572.

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