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.

Previous Showing 61-70 of 210 results. Next

A285764 A relative of the Hofstadter-Conway sequence A004001.

Original entry on oeis.org

1, 2, 3, 3, 3, 3, 4, 5, 6, 6, 6, 6, 7, 8, 9, 10, 11, 12, 12, 12, 12, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 21, 21, 22, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 36, 36, 36, 37
Offset: 1

Views

Author

Nathan Fox, Apr 25 2017

Keywords

Comments

a(n) is the solution to the recurrence relation a(n) = a(a(n-3)) + a(n-a(n-3)), with the initial conditions: a(1) = 1, a(2) = 2, a(3) = a(4) = a(5) = a(6) = 3, a(7) = 4, a(8) = 5, a(9) = 6.
The sequence a(n) is monotonic, with successive terms increasing by 0 or 1. So the sequence hits every positive integer.
This sequence can be obtained from the Hofstadter-Conway sequence A004001 using a construction of Isgur et al.

Crossrefs

Programs

  • Maple
    A285764:=proc(n) option remember: if n <= 0 then 0: elif n = 1 then 1: elif n = 2 then 2: elif n = 3 then 3: elif n = 4 then 3: elif n = 5 then 3: elif n = 6 then 3: elif n = 7 then 4: elif n = 8 then 5: elif n = 9 then 6: else A285764(A285764(n-3)) + A285764(n-A285764(n-3)): fi: end:

A302780 Restricted growth sequence transform of 4-tuple [H(H(n-1)), H(n-H(n-1)), Q(n-Q(n-1)), Q(n-Q(n-2))] where H = A004001 and Q = A005185.

Original entry on oeis.org

1, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 19, 20, 21, 22, 23, 24, 25, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 38, 39, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 47, 50, 50, 50, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 79, 80, 80
Offset: 1

Views

Author

Antti Karttunen, Apr 27 2018

Keywords

Comments

Restricted growth sequence transform of A286560: a filter sequence which includes both the summands of A004001 and the summands of A005185.
For all i, j: a(i) = a(j) => b(i) = b(j), where b is a sequence like A087740, A284019, A286569 or A302779.
For n > 1000 the duplicates get rare. In range [1000, 65536] there are only three cases: a(1353) = a(1354) = 1319, a(39361) = a(39362) = 39326, and a(46695) = a(46696) = 46659.

Crossrefs

Programs

  • PARI
    up_to = 65537;
    first_n_of_A004001(n) = { my(v=vector(n)); v[1]=v[2]=1; for(k=3, n, v[k]=v[v[k-1]]+v[k-v[k-1]]); (v); }; \\ Charles R Greathouse IV, Feb 26 2017
    v004001 = first_n_of_A004001(up_to);
    A004001(n) = v004001[n];
    first_n_of_A005185(n) = { my(v=vector(n)); v[1]=v[2]=1; for(k=3, n, v[k]=v[k-v[k-1]]+v[k-v[k-2]]); (v); }; \\
    v005185 = first_n_of_A005185(up_to);
    A005185(n) = v005185[n];
    Aux302780(n) = if(n<3,0,[A004001(A004001(n-1)), A004001(n-A004001(n-1)), A005185(n-A005185(n-1)), A005185(n-A005185(n-2))]);
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    write_to_bfile(1,rgs_transform(vector(up_to,n,Aux302780(n))),"b302780.txt");

A318056 Let b(1) = b(2) = 1; for n >= 3, b(n) = n - b(t(n)) - b(n-t(n-1)) where t = A004001. a(n) = 2*b(n) - n.

Original entry on oeis.org

1, 0, -1, 0, 1, 0, 1, 0, -3, -2, -3, -2, -1, 0, -1, 0, 5, 4, 5, 4, 5, 2, 1, 2, 3, 4, 3, 0, 1, 0, 1, 0, -11, -10, -11, -10, -11, -10, -7, -6, -7, -6, -9, -10, -9, -8, -7, -8, -3, -4, -3, -2, -1, -2, -5, -4, -5, -4, -1, 0, -1, 0, -1, 0, 21, 20, 21, 20, 21, 20, 21, 16, 15, 16, 15, 16, 19, 20, 19, 20
Offset: 1

Views

Author

Altug Alkan, Aug 14 2018

Keywords

Crossrefs

Programs

  • Maple
    t:= proc(n) option remember; `if`(n<3, 1,
          t(t(n-1)) +t(n-t(n-1)))
        end:
    b:= proc(n) option remember; `if`(n<3, 1,
          n -b(t(n)) -b(n-t(n-1)))
        end:
    seq(2*b(n)-n, n=1..100); # after Alois P. Heinz at A317686
  • Mathematica
    t[1]=t[2]=1; t[n_] := t[n] = t[t[n-1]] + t[n - t[n-1]]; b[1]=b[2]=1; b[n_] := b[n] = n - b[t[n]] - b[n - t[n-1]]; a[n_] := 2*b[n] - n; Array[a, 95] (* after Giovanni Resta at A317854 *)
  • PARI
    t=vector(99); t[1]=t[2]=1; for(n=3, #t, t[n] = t[n-t[n-1]]+t[t[n-1]]); b=vector(99); b[1]=b[2]=1; for(n=3, #b, b[n] = n-b[t[n]]-b[n-t[n-1]]);vector(99, k, 2*b[k]-k)

A089990 a(n) = n step nested walk based on (A004001[n]+ (-1)^lastsum).

Original entry on oeis.org

1, 0, 2, 2, 0, 3, 1, 1, 0, 3, 1, 1, 1, 0, 4, 4, 4, 4, 4, 0, 5, 3, 3, 3, 3, 3, 0, 5, 3, 3, 3, 3, 3, 3, 0, 5, 3, 3, 3, 3, 3, 3, 3, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, 7, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 0, 9, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 9
Offset: 1

Views

Author

Roger L. Bagula, Jan 14 2004

Keywords

Comments

A walk based on A004001.

Crossrefs

Programs

  • Mathematica
    Conway[n_Integer?Positive] := Conway[n] =Conway[Conway[n-1]] + Conway[n - Conway[n-1]] Conway[1] = Conway[2] = 1 digits=20 b=Table[Conway[n], {n, 1, digits}] ChaosWalk[n_Integer?Positive] := NestList[(b[[n]]+(-1)^#)&, 0, n] ChaosWalk[1]=1 a=Flatten[Table[ChaosWalk[n], {n, 1, digits}]]

A089991 Maximum lengths of chaotic walks based on the A004001 sequence.

Original entry on oeis.org

0, 0, 6, 8, 0, 24, 28, 32, 0, 60, 0, 0, 104, 112, 120, 128, 0, 180, 0, 240, 252, 0, 322, 336, 0, 0, 0, 448, 464, 480, 496, 512, 0, 612, 0, 720, 0, 0, 858, 0, 984, 1008, 0, 1144, 1170, 0, 0, 0, 1372, 0, 0, 1560, 1590, 1620, 0, 0, 0, 0, 1888, 1920, 1952, 1984, 2016, 2048, 0
Offset: 1

Views

Author

Roger L. Bagula, Jan 14 2004

Keywords

Crossrefs

Programs

  • Mathematica
    Conway[n_Integer?Positive] := Conway[n] =Conway[Conway[n-1]] + Conway[n - Conway[n-1]] Conway[1] = Conway[2] = 1 digits=200 b=Table[(-1)^Conway[n]*Conway[n], {n, 1, digits}] ChaosWalk[n_Integer?Positive] := NestList[(#+b[[n]])&, 0, n] ChaosWalk[1]=0 a=Table[Max[ChaosWalk[n]], {n, 1, digits}]

Formula

a(n) = MaximumLength[ nested n walk based on A004001[n]*(-1)^A004001[n]+lastsum]

A095767 a(n) = valuation(A004001(n),2).

Original entry on oeis.org

0, 0, 1, 1, 0, 2, 2, 2, 0, 1, 0, 0, 3, 3, 3, 3, 0, 1, 0, 2, 2, 0, 1, 1, 0, 0, 0, 4, 4, 4, 4, 4, 0, 1, 0, 2, 0, 0, 1, 0, 3, 3, 0, 1, 1, 0, 0, 0, 2, 0, 0, 1, 1, 1, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 0, 1, 0, 2, 0, 1, 1, 0, 3, 0, 1, 1, 0, 2, 0, 0, 1, 0, 0, 4, 4, 4, 0, 1, 0, 0, 2, 0, 0, 1, 1, 1, 0, 3, 3, 0, 0, 0, 1, 1, 1
Offset: 1

Views

Author

Benoit Cloitre, Jun 05 2004

Keywords

Crossrefs

Cf. A095768.

Programs

  • Mathematica
    a[1] = a[2] = 1; a[n_] := a[n] = a[a[n - 1]] + a[n - a[n - 1]]; f[n_] := Length[ NestWhileList[ #/2 &, n, IntegerQ[ # ] &]] - 2; Table[ f[ a[n]], {n, 105}] (* Robert G. Wilson v, Jun 11 2004 *)

Formula

Partial formula: a(2^(n+1) - n + i) = n for 0<=i<=n.

A095900 a(n) = A004001(10^n).

Original entry on oeis.org

1, 6, 57, 510, 5373, 53505, 510403, 5247173, 52736107, 511172800, 5189628970, 52334438874, 511861449132, 5150236044255, 52074775905991, 512279427101305, 5118687220533539, 51879201305335167, 512519244788358058
Offset: 0

Views

Author

Robert G. Wilson v, Jun 11 2004

Keywords

Comments

a(n)/n -> 10^n/(2*n). [Corrected by Herman Jamke (hermanjamke(AT)fastmail.fm), Apr 28 2007]

Crossrefs

Cf. A004001.

Programs

  • Mathematica
    a[1] = a[2] = 1; a[n_] := a[n] = a[a[n - 1]] + a[n - a[n - 1]]; Do[ a[n], {n, 1000000}]; Table[ a[10^n], {n, 0, 6}]
  • PARI
    print1("1, ");for(k=1,30,n=10^k;row=floor(log(n)/log(2));col=1;s=0;a=0;while(s1,smd=binomial(row,j-2),smd=2^row);if((s+smd)>n,col=j-1;row=row-1;break,s+=smd;if(j>1,a+=binomial(row-1,j-2),a+=2^(row-1)))));print1(a", ")) \\ Herman Jamke (hermanjamke(AT)fastmail.fm), Apr 28 2007

Extensions

2 more terms from Ryan Propper, Jan 05 2007
More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Apr 28 2007

A116592 a(0)=1; a(n) = b(n+2) + b(n), where b(n) = A004001(n) is the Hofstadter-Conway sequence defined by b(1) = b(2) = 1, b(n) = b(b(n-1)) + b(n-b(n-1)) for n>2.

Original entry on oeis.org

1, 3, 3, 5, 6, 7, 8, 9, 10, 12, 13, 15, 15, 16, 16, 17, 18, 20, 22, 23, 25, 26, 27, 29, 29, 30, 31, 31, 32, 32, 32, 33, 34, 36, 38, 40, 41, 43, 44, 46, 47, 49, 50, 51, 53, 53, 54, 55, 56, 57, 59, 59, 60, 61, 61, 62, 62, 63, 63, 64, 64, 64, 64, 65, 66, 68, 70, 72, 74, 75, 77, 78
Offset: 0

Views

Author

Roger L. Bagula, Mar 27 2006

Keywords

Comments

A similar definition applied to the Fibonacci sequence (A000045) leads to the Lucas sequence (A000032).

Crossrefs

Programs

  • Maple
    b:=proc(n) option remember; if n<=2 then 1 else b(b(n-1))+b(n-b(n-1)): fi: end: seq(b(n),n=1..71): a:=proc(n) if n=0 then 1 else b(n+2)+b(n) fi end: seq(a(n),n=0..71);
  • Mathematica
    Cw[0] = 0; Cw[1] = Cw[2] = 1; Cw[n_Integer?Positive] := Cw[n] = Cw[Cw[n - 1]] + Cw[n - Cw[n - 1]]; L[0] = 1; L[n_] := L[n] = Cw[n - 1] + Cw[n + 1]; Table[L[n], {n, 1, 200}]

Formula

a(n) = A004001(n+2) + A004001(n) for n>=1.

Extensions

Edited by N. J. A. Sloane, Apr 15 2006

A121459 Let f(n) = A004001(n)^2 - A005185(n)^2. Then a(n) = f(abs(f(n-1))) + f(abs(n - f(n-1))).

Original entry on oeis.org

0, -3, -14, -18, -7, -9, -47, -51, 0, -15, -15, -48, -17, -36, 57, -151, 0, -63, 0, -11, 0, 25, 26, 368, 29, -5, -96, -33, 0, -144, 2275, -466, -180, 433, 472, 0, -43, 316, 0, 0, 47, -302, 49, 152, 1122, 945, 1273, 10170, 589, 1310, 121, 54, 3117, 0, 177, 2141, -1280, -5, 310, 0
Offset: 1

Views

Author

Roger L. Bagula, Sep 06 2006

Keywords

Crossrefs

Programs

  • Mathematica
    HConway[n_]:= HConway[n]= If[n<3, 1, HConway[HConway[n-1]] + HConway[n-HConway[n -1]]];
    Hofstadter[n_]:= Hofstadter[n]= If[n<3, 1, Hofstadter[n -Hofstadter[n-1]] + Hofstadter[n -Hofstadter[n-2]]];
    f[n_]:= f[n]= HConway[n]^2 - Hofstadter[n]^2;
    Table[f[Abs[f[n-1]]] + f[Abs[n -f[n-1]]], {n,60}] (* corrected by G. C. Greubel, Feb 12 2020 *)

Extensions

Edited by N. J. A. Sloane, Oct 01 2006
Terms a(31) and beyond corrected by G. C. Greubel, Feb 12 2020

A135687 a(n) = a(n-1) - A004001(n)*a(n-2), a(1) = 1, a(2) = 1.

Original entry on oeis.org

1, 1, -1, -3, 0, 12, 12, -36, -96, 120, 792, -48, -6384, -6000, 45072, 93072, -312576, -1243296, 2195040, 17114592, -9225888, -231715584, -102553152, 3141465024, 4679762304, -42442213056, -112638647616, 566436761280, 2368655123136, -6694333057344, -44592815027520
Offset: 1

Views

Author

Roger L. Bagula, Feb 19 2008

Keywords

Crossrefs

Programs

  • Mathematica
    HC[n_]:= HC[n]= If[n<3, Fibonacci[n], HC[HC[n-1]] +HC[n -HC[n-1]]]; (*A004001*)
    a[n_]:= a[n]= If[n<3, 1, a[n-1] - HC[n]*a[n-2]];
    Table[a[n], {n, 40}]
  • Sage
    @cached_function
    def HC(n): # HC = A004001
        if (n<3): return fibonacci(n)
        else: return HC(HC(n-1)) +HC(n -HC(n-1))
    @CachedFunction
    def a(n): # A135688
        if (n<3): return 1
        else: return a(n-1) - HC(n)*a(n-2)
    [a(n) for n in (1..40)] # G. C. Greubel, Nov 25 2021

Formula

a(n) = a(n-1) - A004001(n)*a(n-2), with a(1) = a(2) = 1.
Previous Showing 61-70 of 210 results. Next