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.

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