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

A288070 a(n) is the least number that enters a cycle of length 2n in the iteration sequence s(0)=n, s(k+1) = s(k) + (-1)^k*d(s(k)), where d(n) is the number of divisors of n (A000005).

Original entry on oeis.org

3, 93, 273, 1617, 684, 3993, 58695, 91355, 572793, 167055, 441519, 13991016, 2337513, 20225991, 48163788, 20625997, 148789675, 470944675, 626064036, 506112555, 963071088, 494359089, 3252701700, 3972446520, 4515893681, 3472027000, 9096968436
Offset: 1

Views

Author

Michel Marcus, Jun 05 2017

Keywords

Crossrefs

Cf. A000005, A049820, A062249, A175304 (numbers with cycle of length 2), A285004 (records of this sequence).

Programs

  • Mathematica
    nmax=10;lst=ConstantArray[0,nmax];For[n=2, n<10^6, n++; c=1; v={}; m=0; s=1; a=n; i={}; While[m<10^6, AppendTo[v, a]; If[Length[v] > 3, i=LongestCommonSubsequencePositions[v[[1;; -3]], v[[-2;; -1]]], i = {}];
    If[Length[i]==2 && Differences[i[[1]]][[1]]==1, c=Length[v]-i[[1]][[1]]-1; Break[]]; m++; a = a + s*DivisorSigma[0, a]; s = -s; ]; If[c/2Amiram Eldar, Jun 05 2017 *)
  • PARI
    findpos(v, new) = {for(i=1, #v, if (v[#v-i+1] == new, return (i)););}
    loop(n) = {my(k = 1, ok = 0, v = []); while(!ok, new = n + k*numdiv(n); if (pos = findpos (v, new), if (#v > pos, if (v[#v] == v[#v - pos], return (pos)););); n = new; k = -k; v = concat(v, new););}
    a(n) = my(k=3); while (loop(k) != 2*n, k++); k;

Extensions

a(19)-a(27) from Giovanni Resta, Jun 06 2017
Showing 1-1 of 1 results.