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.

A324294 a(n) = A002487(1+sigma(n)).

Original entry on oeis.org

1, 1, 3, 1, 3, 5, 4, 1, 3, 7, 5, 7, 4, 7, 7, 1, 7, 3, 8, 13, 6, 11, 7, 9, 1, 13, 11, 10, 5, 15, 6, 1, 9, 11, 9, 7, 10, 9, 10, 19, 13, 11, 12, 21, 13, 15, 9, 11, 7, 9, 15, 16, 11, 13, 15, 13, 14, 19, 9, 29, 6, 11, 18, 1, 21, 19, 14, 7, 11, 19, 15, 9, 18, 17, 11, 22, 11, 29, 14, 25, 9, 7, 21, 16, 19, 17, 13, 31, 19, 29, 13, 29, 8, 19, 13, 13, 16
Offset: 1

Views

Author

Antti Karttunen, Feb 22 2019

Keywords

Crossrefs

Programs

  • Mathematica
    A002487[m_] := Module[{a = 1, b = 0, n = m}, While[n > 0, If[OddQ[n], b = a + b, a = a + b]; n = Floor[n/2]]; b];
    a[n_] := A002487[1 + DivisorSigma[1, n]];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Mar 11 2023 *)
  • PARI
    A002487(n) = { my(s=sign(n), a=1, b=0); n = abs(n); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (s*b); };
    A324294(n) = A002487(1+sigma(n));
    
  • Python
    from functools import reduce
    from sympy import divisor_sigma
    def A324294(n): return reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(divisor_sigma(n)+1)[-1:1:-1],(1,0))[1] # Chai Wah Wu, Jun 19 2022

Formula

a(n) = A002487(1+sigma(n)).
a(2^n) = 1 for all n >= 0, but also for some other numbers, e.g., a(25) = 1.

A332224 a(n) = A087808(sigma(n)).

Original entry on oeis.org

1, 2, 4, 3, 4, 8, 8, 4, 5, 10, 8, 12, 6, 16, 16, 5, 10, 7, 12, 14, 32, 20, 16, 16, 5, 14, 24, 24, 8, 40, 32, 6, 32, 12, 32, 10, 12, 16, 24, 18, 14, 64, 16, 28, 14, 40, 32, 20, 13, 11, 40, 34, 12, 32, 40, 32, 48, 18, 16, 56, 10, 64, 40, 7, 28, 80, 36, 12, 64, 80, 40, 34, 22, 26, 20, 40, 64, 56, 48, 22, 17, 12, 28, 96, 24, 68, 32, 36, 18
Offset: 1

Views

Author

Antti Karttunen, Feb 12 2020

Keywords

Crossrefs

Cf. also A324293.

Programs

  • Mathematica
    Block[{s = DivisorSigma[1, Range[90]], t}, t = Nest[Append[#1, If[EvenQ[#2], 2 #1[[#2/2 + 1]], #1[[(#2 - 1)/2 + 1]] + 1]] & @@ {#, Length@ #} &, {0}, Max@ s]; t[[Most@ s + 1]] ] (* Michael De Vlieger, Feb 12 2020 *)
  • PARI
    A087808(n) = if(n<1, 0, if(n%2==0, 2*A087808(n/2), A087808((n-1)/2)+1));
    A332224(n) = A087808(sigma(n));

Formula

a(n) = A087808(A000203(n)).

A324287 a(n) = A002487(A005187(n)).

Original entry on oeis.org

0, 1, 2, 1, 3, 1, 3, 5, 4, 1, 4, 7, 5, 7, 7, 5, 5, 1, 5, 9, 7, 10, 11, 8, 7, 9, 9, 7, 13, 8, 3, 10, 6, 1, 6, 11, 9, 13, 15, 11, 10, 13, 14, 11, 21, 13, 5, 17, 9, 11, 11, 9, 19, 12, 5, 18, 19, 11, 3, 13, 7, 18, 15, 4, 7, 1, 7, 13, 11, 16, 19, 14, 13, 17, 19, 15, 29, 18, 7, 24, 13, 16, 17, 14, 30, 19, 8, 29, 31, 18, 5, 22, 12, 31, 26, 7
Offset: 0

Views

Author

Antti Karttunen, Feb 20 2019

Keywords

Comments

The motivation for this kind of sequence was a question: what kind of simply defined non-injective functions f exist such that this sequence can be defined as their function, e.g., as a(n) = g(f(n)), where g is a nontrivial integer-valued function? The same question can also be asked about A324288, A324337 and A324338. Note that A005187, A283477 and A006068 used in their definitions are all injections. Of course, A324377(n) = A000265(A005187(n)) fills the bill as A002487(n) = A002487(A000265(n)), but are there any less obvious solutions? - Antti Karttunen, Feb 28 2019

Crossrefs

Programs

  • PARI
    A002487(n) = { my(s=sign(n), a=1, b=0); n = abs(n); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (s*b); }; \\ Modified from the one given in A002487, sign not actually needed here.
    A005187(n) = { my(s=n); while(n>>=1, s+=n); s; };
    A324287(n) = A002487(A005187(n));
    
  • Python
    from functools import reduce
    def A324287(n): return sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin((n<<1)-n.bit_count())[-1:2:-1],(1,0))) if n else 0 # Chai Wah Wu, May 05 2023

Formula

a(n) = A002487(A005187(n)).
a(n) = A324286(A283477(n)).
a(n) = A002487(A324377(n)).
Showing 1-3 of 3 results.