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

A155043 a(0)=0; for n >= 1, a(n) = 1 + a(n-d(n)), where d(n) is the number of divisors of n (A000005).

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, Jan 19 2009

Keywords

Comments

From Antti Karttunen, Sep 23 2015: (Start)
Number of steps needed to reach zero when starting from k = n and repeatedly applying the map that replaces k by k - d(k), where d(k) is the number of divisors of k (A000005).
The original name was: a(n) = 1 + a(n-sigma_0(n)), a(0)=0, sigma_0(n) number of divisors of n.
(End)

Crossrefs

Sum of A262676 and A262677.
Cf. A261089 (positions of records, i.e., the first occurrence of n), A262503 (the last occurrence), A262505 (their difference), A263082.
Cf. A262518, A262519 (bisections, compare their scatter plots), A262521 (where the latter is less than the former).
Cf. A261085 (computed for primes), A261088 (for squares).
Cf. A262507 (number of times n occurs in total), A262508 (values occurring only once), A262509 (their indices).
Cf. A263265 (nonnegative integers arranged by the magnitude of a(n)).
Cf. also A004001, A005185.
Cf. A264893 (first differences), A264898 (where repeating values occur).

Programs

  • Haskell
    import Data.List (genericIndex)
    a155043 n = genericIndex a155043_list n
    a155043_list = 0 : map ((+ 1) . a155043) a049820_list
    -- Reinhard Zumkeller, Nov 27 2015
    
  • Maple
    with(numtheory): a := proc (n) if n = 0 then 0 else 1+a(n-tau(n)) end if end proc: seq(a(n), n = 0 .. 90); # Emeric Deutsch, Jan 26 2009
  • Mathematica
    a[0] = 0; a[n_] := a[n] = 1 + a[n - DivisorSigma[0, n]]; Table[a@n, {n, 0, 82}] (* Michael De Vlieger, Sep 24 2015 *)
  • PARI
    uplim = 110880; \\ = A002182(30).
    v155043 = vector(uplim);
    v155043[1] = 1; v155043[2] = 1;
    for(i=3, uplim, v155043[i] = 1 + v155043[i-numdiv(i)]);
    A155043 = n -> if(!n,n,v155043[n]);
    for(n=0, uplim, write("b155043.txt", n, " ", A155043(n)));
    \\ Antti Karttunen, Sep 23 2015
    
  • Python
    from sympy import divisor_count as d
    def a(n): return 0 if n==0 else 1 + a(n - d(n))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 03 2017
  • Scheme
    (definec (A155043 n) (if (zero? n) n (+ 1 (A155043 (A049820 n)))))
    ;; Antti Karttunen, Sep 23 2015
    

Formula

From Antti Karttunen, Sep 23 2015 & Nov 26 2015: (Start)
a(0) = 0; for n >= 1, a(n) = 1 + a(A049820(n)).
a(n) = A262676(n) + A262677(n). - Oct 03 2015.
Other identities. For all n >= 0:
a(A259934(n)) = a(A261089(n)) = a(A262503(n)) = n. [The sequence works as a left inverse for sequences A259934, A261089 and A262503.]
a(n) = A262904(n) + A263254(n).
a(n) = A263270(A263266(n)).
A263265(a(n), A263259(n)) = n.
(End)

Extensions

Extended by Emeric Deutsch, Jan 26 2009
Name edited by Antti Karttunen, Sep 23 2015

A263077 a(n) = greatest k where A155043(k) < A155043(n).

Original entry on oeis.org

0, 0, 2, 2, 6, 2, 12, 6, 6, 6, 12, 6, 18, 12, 18, 18, 22, 12, 30, 18, 30, 18, 34, 22, 22, 22, 42, 22, 48, 22, 60, 30, 60, 30, 72, 48, 84, 34, 84, 34, 96, 34, 108, 42, 96, 42, 108, 42, 48, 48, 120, 48, 132, 48, 132, 48, 140, 60, 140, 48, 140, 72, 140, 140, 140, 72, 140, 84, 140, 84, 140, 60, 140, 96, 140, 96, 150, 96, 156, 96, 108, 108, 120, 72, 120, 120, 132, 108, 140, 108, 140, 132, 140, 120, 140, 84
Offset: 1

Views

Author

Antti Karttunen, Oct 09 2015

Keywords

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[n_] := a[n] = 1 + a[n - DivisorSigma[0, n]]; Table[k = 3 n;
    While[a@ k >= a@ n, k--]; k, {n, 96}] (* Michael De Vlieger, Oct 13 2015 *)
  • PARI
    allocatemem((2^31)+(2^30));
    uplim1 = 36756720 + 640; \\ = A002182(53) + A002183(53).
    uplim2 = 36756720; \\ = A002182(53).
    uplim3 = 32432400; \\ = A002182(52). Really just some Ad Hoc value smaller than above.
    v155043 = vector(uplim1);
    vother = vector(uplim3); \\ Contains A262503 and A263082 in succession.
    v155043[1] = 1; v155043[2] = 1;
    for(i=3, uplim1, v155043[i] = 1 + v155043[i-numdiv(i)]; if(!(i%1048576),print1(i,", ")));
    A155043 = n -> if(!n,n,v155043[n]);
    maxlen = 0; for(i=1, uplim2, len = v155043[i]; vother[len] = i; maxlen = max(maxlen,len); if(!(i%1048576),print1(i,", "))); \\ First it will be A262503.
    print("uplim2=", uplim2, " uplim3=", uplim3, " maxlen=", maxlen);
    \\ Then we convert it to A263082:
    m = 0; for(i=1, maxlen, m = max(m, vother[i]); vother[i] = m; if(!(i%1048576),print1(i,", ")));
    A263082 = n -> if(!n,n,vother[n]);
    A263077 = n -> A263082(A155043(n)-1);
    \\ Finally we can compute A263077:
    for(i=1, uplim3, write("b263077.txt", i, " ", A263077(i)); );

Formula

a(n) = A263082(A155043(n)-1).

A263078 a(n) = greatest k for which A155043(n+k) < A155043(n); a(n) = A263077(n)-n.

Original entry on oeis.org

-1, -2, -1, -2, 1, -4, 5, -2, -3, -4, 1, -6, 5, -2, 3, 2, 5, -6, 11, -2, 9, -4, 11, -2, -3, -4, 15, -6, 19, -8, 29, -2, 27, -4, 37, 12, 47, -4, 45, -6, 55, -8, 65, -2, 51, -4, 61, -6, -1, -2, 69, -4, 79, -6, 77, -8, 83, 2, 81, -12, 79, 10, 77, 76, 75, 6, 73, 16, 71, 14, 69, -12, 67, 22, 65, 20, 73, 18, 77, 16, 27, 26, 37, -12, 35, 34, 45, 20, 51, 18, 49, 40, 47, 26, 45, -12, 43, 42, 41, 40, 39, 30
Offset: 1

Views

Author

Antti Karttunen, Oct 09 2015

Keywords

Examples

			For n=1 we have A049820(1) = 0, thus A155043(1) = 1, and 0 is the only (and thus the largest) number from which zero can be reached with less steps (namely in zero steps, A155043(0) = 0), thus a(1) = 0 - 1 = -1.
For n=7, we have A155043(7) = 4 [as A049820(7) = 5, A049820(5) = 3, A049820(3) = 1, A049820(1) = 0], but there exists x=12 for which we have A049820(12) = 6, A049820(6) = 2, A049820(2) = 0, and this is the largest x such that A155043(x) < A155043(7), thus a(7) = 12 - 7 = 5.
		

Crossrefs

Cf. A263079 (indices of the negative terms), A263080 (of the positive terms).

Programs

  • Mathematica
    a[0] = 0; a[n_] := a[n] = 1 + a[n - DivisorSigma[0, n]]; Table[k = 3 n;
    While[a@ k >= a@ n, k--]; k - n, {n, 102}] (* Michael De Vlieger, Oct 13 2015 *)
  • PARI
    A263078 = n -> A263077(n) - n;
    for(n=1,124340,write("b263078.txt",n," ",A263078(n)));
    \\ Other code as in A263077

Formula

a(n) = A263077(n)-n.

A263080 Numbers n for which there exists x > n such that A155043(x) < A155043(n); numbers n for which A263078(n) is positive.

Original entry on oeis.org

5, 7, 11, 13, 15, 16, 17, 19, 21, 23, 27, 29, 31, 33, 35, 36, 37, 39, 41, 43, 45, 47, 51, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97, 98, 99, 100, 101, 102, 103, 105, 106, 107, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121
Offset: 1

Views

Author

Antti Karttunen, Oct 09 2015

Keywords

Examples

			5 is present, because if we start iterating A049820 from it as: A049820(5) = 3, A049820(3) = 1, A049820(1) = 0, we get a path of length 3 to reach zero, thus A155043(5) = 3. On the other hand, if we start from 6, the path is one step shorter: A049820(6) = 2, A049820(2) = 0 [i.e., A155043(6) = 2], thus there exists a number larger than 5 which results a shorter path to zero.
		

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[n_] := a[n] = 1 + a[n - DivisorSigma[0, n]]; Position[Table[k = 3 n; While[a@ k >= a@ n, k--]; k - n, {n, 121}], Integer?Positive] // Flatten (* _Michael De Vlieger, Oct 13 2015 *)
  • PARI
    n=0; i=0; while(i < 10000, n++; if((A263077(n) > n), i++; write("b263080.txt",i," ",n)));
    \\ Other code as in A263077.
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A263080 (MATCHING-POS 1 1 (COMPOSE positive? A263078)))

A263082 a(n) = Max( A262503(k) : k=0,1,2,3,...,n ), where A262503(k) = largest x such that A155043(x) = k.

Original entry on oeis.org

0, 2, 6, 12, 18, 22, 30, 34, 42, 48, 60, 72, 84, 96, 108, 120, 132, 140, 140, 140, 140, 140, 140, 140, 150, 156, 168, 180, 180, 184, 192, 204, 216, 228, 240, 248, 264, 280, 280, 280, 280, 288, 296, 312, 312, 320, 328, 340, 352, 364, 372, 372, 372, 372, 384, 396, 420, 420, 420, 420, 432, 450, 468, 480, 504, 520, 540, 560, 572, 580, 594, 612, 612, 618, 622, 628, 648, 672, 672, 672, 672, 672
Offset: 0

Views

Author

Antti Karttunen, Oct 09 2015

Keywords

Comments

From position a(n)+1 onward only terms > n will occur in A155043.

Crossrefs

Formula

a(0) = 0; for n >= 1, a(n) = max(A262503(n),a(n-1)).
Other identities and observations:
For all n >= 0 and for any k > a(n): A155043(k) > n. [See the comment above.]
For all n >= 0: A155043(a(n)) <= n.
Showing 1-5 of 5 results.