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.

A290077 a(n) = A000010(A005940(1+n)).

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 6, 4, 6, 4, 8, 4, 20, 6, 18, 8, 10, 6, 12, 8, 24, 8, 24, 8, 42, 20, 40, 12, 100, 18, 54, 16, 12, 10, 20, 12, 40, 12, 36, 16, 60, 24, 48, 16, 120, 24, 72, 16, 110, 42, 84, 40, 168, 40, 120, 24, 294, 100, 200, 36, 500, 54, 162, 32, 16, 12, 24, 20, 48, 20, 60, 24, 72, 40, 80, 24, 200, 36, 108, 32, 120, 60, 120
Offset: 0

Views

Author

Antti Karttunen, Jul 19 2017

Keywords

Comments

Each n occurs A014197(n) times in total in this sequence.

Crossrefs

Programs

  • Mathematica
    f[n_, i_, x_]:=f[n, i, x]=Which[n==0, x, EvenQ[n], f[n/2, i + 1, x], f[(n - 1)/2, i, x Prime[i]]]; a005940[n_]:=f[n - 1, 1, 1]; Table[EulerPhi[a005940[n + 1]], {n, 0, 100}] (* Indranil Ghosh, Jul 20 2017 *)
  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    A290077(n) = eulerphi(A005940(1+n));
    
  • 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); }; \\ Antti Karttunen, Aug 05 2023
    
  • Sage
    def A290077(n):
        i = 1
        m = 1
        while n > 0:
          if 0==(n%2):
            n = n//2
            i += 1
          else:
            if(1==(n%4)):
              n = (n-1)//4
              m *= sloane.A000040(i)-1
              i += 1
            else:
              n = (n-1)//2
              m *= sloane.A000040(i)
        return m
    
  • Scheme
    (define (A290077 n) (A000010 (A005940 (+ 1 n))))
    
  • Scheme
    (define (A290077 n) (let loop ((n n) (m 1) (i 1)) (cond ((zero? n) m) ((even? n) (loop (/ n 2) m (+ 1 i))) ((= 1 (modulo n 4)) (loop (/ (- n 1) 4) (* m (- (A000040 i) 1)) (+ 1 i))) (else (loop (/ (- n 1) 2) (* m (A000040 i)) i))))) ;; Requires only an implementation of A000040, see for example under A083221.

Formula

a(n) = A000010(A005940(1+n)).

A364567 a(n) = A297112(A005940(1+n)), where A297112 is the Möbius transform of A156552 [the inverse of map n -> A005940(1+n)].

Original entry on oeis.org

0, 1, 2, 2, 4, 2, 4, 4, 8, 4, 4, 4, 8, 4, 8, 8, 16, 8, 8, 8, 8, 4, 8, 8, 16, 8, 8, 8, 16, 8, 16, 16, 32, 16, 16, 16, 16, 8, 16, 16, 16, 8, 8, 8, 16, 8, 16, 16, 32, 16, 16, 16, 16, 8, 16, 16, 32, 16, 16, 16, 32, 16, 32, 32, 64, 32, 32, 32, 32, 16, 32, 32, 32, 16, 16, 16, 32, 16, 32, 32, 32, 16, 16, 16, 16, 8, 16, 16
Offset: 0

Views

Author

Antti Karttunen, Aug 05 2023

Keywords

Crossrefs

Programs

  • PARI
    A364567(n) = if(!n,n, my(i=1); while(n>1, if((n%4)!=1, i<<=1); n >>= 1); (i));

Formula

For n > 0, a(n) = 2^A033265(n).
Showing 1-3 of 3 results.