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-10 of 26 results. Next

A326991 First quadrisection of A133058.

Original entry on oeis.org

1, 2, 3, 2, 3, 48, 4, 34, 2, 3, 3, 104, 41, 97, 131, 77, 133, 167, 95, 80, 82, 43, 90, 47, 33, 33, 254, 8, 284, 432, 6, 47, 107, 125, 265, 341, 385, 8, 384, 55, 31, 130, 350, 56, 200, 41, 295, 217, 69, 327, 15, 103, 210, 107, 73, 17, 2, 3, 3, 552, 83, 203, 131, 221, 73, 85, 437, 574, 347, 293, 113, 481, 636
Offset: 0

Views

Author

Omar E. Pol, Aug 11 2019

Keywords

Comments

After the initial chaos, starting with n = 160 we have the spoke 1282, 1290, 1298, 1306, ...

Crossrefs

Formula

a(n) = A133058(4n) = A133058(A008586(n)).
For n >= 160; a(n) = 8*n + 2.

A326992 Second quadrisection of A133058.

Original entry on oeis.org

1, 8, 1, 16, 21, 16, 30, 64, 36, 41, 45, 150, 91, 151, 189, 139, 199, 237, 169, 158, 164, 129, 180, 141, 131, 135, 360, 118, 398, 48, 128, 173, 237, 259, 403, 483, 77, 158, 128, 213, 193, 26, 520, 230, 378, 223, 59, 31, 263, 525, 5, 309, 420, 321, 291, 1, 228, 233, 237, 184, 325, 29, 381, 475, 331
Offset: 0

Views

Author

Omar E. Pol, Aug 11 2019

Keywords

Comments

After the initial chaos, starting with n = 160 we have the spoke 2, 2, 2, 2, ...

Crossrefs

Formula

a(n) = A133058(4n+1) = A133058(A016813(n)).
For n >= 160; a(n) = 2.

A326993 Third quadrisection of A133058.

Original entry on oeis.org

4, 4, 12, 8, 7, 8, 15, 32, 18, 80, 15, 75, 142, 206, 248, 202, 266, 308, 244, 79, 2, 3, 2, 3, 230, 45, 180, 59, 199, 24, 64, 300, 368, 394, 542, 626, 224, 79, 64, 372, 356, 13, 52, 115, 189, 406, 246, 222, 458, 175, 208, 3, 2, 3, 510, 224, 114, 464, 79, 92, 568, 276, 632, 730, 590, 610, 37, 422, 896, 850
Offset: 0

Views

Author

Omar E. Pol, Aug 11 2019

Keywords

Comments

After the initial chaos, starting with n = 159 we have the spoke 1, 1, 1, 1, ...

Crossrefs

Formula

a(n) = A133058(4n+2) = A133058(A016825(n)).
For n >= 159; a(n) = 1.

A326994 Fourth quadrisection of A133058.

Original entry on oeis.org

8, 12, 24, 24, 27, 32, 5, 64, 54, 120, 59, 123, 194, 262, 308, 266, 334, 380, 320, 1, 86, 1, 94, 99, 330, 149, 288, 171, 315, 144, 188, 428, 500, 530, 682, 770, 32, 231, 220, 124, 520, 181, 224, 23, 369, 590, 434, 414, 654, 375, 412, 1, 214, 219, 170, 448, 342, 696, 315, 332, 812, 524, 884, 146, 850, 874, 305
Offset: 0

Views

Author

Omar E. Pol, Aug 11 2019

Keywords

Comments

After the initial chaos, starting with n = 159 we have the spoke 641, 645, 649, 653, ...

Crossrefs

Formula

a(n) = A133058(4n+3) = A133058(A004767(n)).
For n >= 159; a(n) = 4*n + 5.

A309627 Starting numbers k such that the trajectory of k under the map x -> A133058(x) joins A133058.

Original entry on oeis.org

6, 8, 11, 12, 19, 25, 30, 32, 45, 46, 47, 52, 53, 55, 58, 59, 60, 63, 64, 76, 95, 97, 98, 99, 101, 102, 107, 108, 114, 118, 124, 126, 132, 134, 137, 140, 144, 152, 156, 157, 159, 163, 169, 173, 177, 180, 181, 185, 187, 188, 189, 198, 199, 200, 202, 203, 206, 207, 208, 209, 210
Offset: 1

Views

Author

Tomas Tkac, Aug 10 2019

Keywords

Examples

			Quite a few starting numbers f(0) for the recurrence defined in A133058 will produce a sequence which eventually join A133058, the smallest such number being 6. 8 joins 6 at the 10th term, 11 joins 6 at the 17th term, 12 joins the sequence at the 97th term, etc.
		

Crossrefs

Cf. A133058.

Extensions

Entry revised by Editors of the OEIS, Oct 01 2019

A339571 A133058 with duplicates removed.

Original entry on oeis.org

1, 4, 8, 2, 12, 3, 24, 16, 21, 7, 27, 48, 32, 30, 15, 5, 34, 64, 36, 18, 54, 41, 80, 120, 45, 59, 104, 150, 75, 123, 91, 142, 194, 97, 151, 206, 262, 131, 189, 248, 308, 77, 139, 202, 266, 133, 199, 334, 167, 237, 380, 95, 169, 244, 320, 158, 79, 82, 164, 86
Offset: 1

Views

Author

N. J. A. Sloane, Dec 09 2020

Keywords

Crossrefs

Cf. A133058.

Programs

  • Mathematica
    DeleteDuplicates@ Block[{a = {1, 1}, k = 1}, Do[AppendTo[a, If[# == 1, a[[-1]] + i + 1, a[[-1]]/#]] &@ GCD[a[[-1]], i], {i, 2, 80}]; a] (* Michael De Vlieger, Dec 09 2020 *)
  • PARI
    lista(nn) = my(v=List([1]), x=1, y); print1(1); for(n=2, nn, if(!setsearch(Set(v), x=if(1==y=gcd(x, n), x+n+1, x/y)), print1(", ", x); listput(v, x))); \\ Jinyuan Wang, Dec 12 2020
    
  • Python
    from math import gcd
    from itertools import count, islice
    def A339571_gen(): # generator of terms
        a, aset = 1, {1}
        yield 1
        for n in count(2):
            a = a+n+1 if (b:=gcd(a,n)) == 1 else a//b
            if a not in aset:
                aset.add(a)
                yield a
    A339571_list = list(islice(A339571_gen(),30)) # Chai Wah Wu, Mar 18 2023

Extensions

More terms from Jinyuan Wang, Dec 12 2020

A133579 a(0)=a(1)=1; for n > 1, a(n) = 3*a(n-1) if a(n-1) and n are coprime, otherwise a(n) = a(n-1)/gcd(a(n-1), n).

Original entry on oeis.org

1, 1, 3, 1, 3, 9, 3, 9, 27, 3, 9, 27, 9, 27, 81, 27, 81, 243, 27, 81, 243, 81, 243, 729, 243, 729, 2187, 81, 243, 729, 243, 729, 2187, 729, 2187, 6561, 729, 2187, 6561, 2187, 6561, 19683, 6561, 19683, 59049, 6561, 19683, 59049, 19683, 59049, 177147
Offset: 0

Views

Author

Ctibor O. Zizka, Dec 26 2007

Keywords

Crossrefs

Programs

  • Maple
    f:=proc(n) option remember;
    if n <= 1 then 1
    elif gcd(n,f(n-1))>1 then f(n-1)/gcd(n,f(n-1))
    else 3*f(n-1); fi; end;
    [seq(f(n),n=0..50)];
    # N. J. A. Sloane, Feb 14 2015
  • Mathematica
    nxt[{n_,a_}]:={n+1,If[CoprimeQ[a,n+1],3a,a/GCD[a,n+1]]}; Join[{1}, Transpose[ NestList[nxt,{1,1},50]][[2]]] (* Harvey P. Dale, Feb 14 2015 *)
  • PARI
    A=vector(1000,i,1);for(n=2,#A,A[n]=if(gcd(A[n-1],n)>1,A[n-1]/gcd(A[n-1],n),A[n-1]*3)) \\ M. F. Hasler, Feb 15 2015

Extensions

Offset, definition, and terms corrected by N. J. A. Sloane, Feb 14 2015

A255140 a(1) = 1, a(n+1) = a(n)/gcd(a(n),n) if this gcd is > 1, else a(n+1) = a(n) + n + 2.

Original entry on oeis.org

1, 4, 2, 7, 13, 20, 10, 19, 29, 40, 4, 17, 31, 46, 23, 40, 5, 24, 4, 25, 5, 28, 14, 39, 13, 40, 20, 49, 7, 38, 19, 52, 13, 48, 24, 61, 99, 138, 69, 23, 65, 108, 18, 63, 109, 156, 78, 127, 177, 228, 114, 38, 19, 74, 37, 94, 47, 106, 53, 114, 19, 82, 41, 106
Offset: 1

Views

Author

M. F. Hasler, Feb 15 2015

Keywords

Comments

A variant of A133058, less trivial than A255051: The sequence looks irregular up to index n = 82, where it enters a 4-periodic pattern (1, x, 2x, x), cf. formula. Sequence A255051 starts right from the beginning with the pattern (1, x, 2x, 2), whereas sequence A133058 enters such a pattern only at index n = 641.

Examples

			a(2) = a(1) + 3 = 4, a(3) = a(2)/2 = 2, a(4) = a(3) + 5 = 7, a(5) = a(4) + 6 = 13, ...
		

Crossrefs

Programs

  • Magma
    a:=[1]; for n in [2..65] do if Gcd(a[n-1],n-1) gt 1 then Append(~a, a[n-1] div Gcd(a[n-1],n-1)); else Append(~a, a[n-1] +n+1); end if; end for; a; // Marius A. Burtea, Jan 11 2020
  • Mathematica
    nxt[{n_,a_}]:=Module[{g=GCD[a,n]},{n+1,If[g>1,a/g,a+n+2]}]; NestList[nxt,{1,1},70][[All,2]] (* Harvey P. Dale, Oct 12 2019 *)
  • PARI
    A255140_vec(N)=vector(N, n, if(gcd(N,n-1)>1||n==1, N/=gcd(N, n-1), N+=n+1)) \\ Original code simplified by M. F. Hasler, Jan 11 2020
    
  • PARI
    A255140(n)=if(n < 82, A255140_upto(n)[n], [2*n+2,n,1,n+2][n%4+1]) \\ M. F. Hasler, Jan 17 2020
    

Formula

For k > 20, a(4k) = 8k + 2 = 2*a(4k +- 1), a(4k - 2) = 1; equivalently:
a(n) = 2n + 2, n, 1 or n+2 when n = 4k+r > 81 with r = 0, 1, 2 or 3, respectively.

Extensions

Edited by M. F. Hasler, Jan 11 2020

A133580 a(0)=a(1)=1; for n>1, a(n) = 2*a(n-1) + 1 if a(n-1) and n are coprime, otherwise a(n) = a(n-1)/gcd(a(n-1),n).

Original entry on oeis.org

1, 1, 3, 1, 3, 7, 15, 31, 63, 7, 15, 31, 63, 127, 255, 17, 35, 71, 143, 287, 575, 1151, 2303, 4607, 9215, 1843, 3687, 1229, 2459, 4919, 9839, 19679, 39359, 78719, 157439, 314879, 629759, 1259519, 2519039, 5038079, 10076159, 20152319, 40304639
Offset: 0

Views

Author

Ctibor O. Zizka, Dec 26 2007

Keywords

Comments

The initial value a(0)=1 is somehow artificial; using a(0)=0 would yield the same subsequent terms using the recurrence formula already for n=1. - M. F. Hasler, Feb 15 2015

Examples

			Write the GCD of a(n-1) and n under a(n-1):
n = : 0 1 2 3 4 5  6  7  8 9 ...
a(n): 1 1 3 1 3 7 15 31 63 7 ...
gcd : 1 1 3 1 1 1  1  1  9 1 ...
		

Crossrefs

Programs

  • Mathematica
    a = {1, 1}; Do[If[GCD[n, a[[ -1]]] == 1, b = 2*a[[ -1]] + 1, b = a[[ -1]]/GCD[a[[ -1]], n]]; AppendTo[a, b], {n, 2, 50}]; a (* Stefan Steinerberger, Dec 31 2007 *)
    nxt[{a_,b_}]:={a+1,If[CoprimeQ[b,a+1],2b+1,b/GCD[b,a+1]]}; Join[{1}, Transpose[ NestList[nxt,{1,1},50]][[2]]] (* Harvey P. Dale, Sep 16 2012 *)
  • PARI
    A=vector(1000,i,1);for(n=2,#A,A[n]=if(gcd(A[n-1],n)>1,A[n-1]/gcd(A[n-1],n),A[n-1]*2+1)) \\ M. F. Hasler, Feb 15 2015
    
  • PARI
    a=0;#A133580=vector(1000,n,a=if(gcd(a,n)>1,a/gcd(a,n),a*2+1)) \\ M. F. Hasler, Feb 15 2015

Extensions

Corrected and extended by Stefan Steinerberger, Dec 31 2007
Offset changed to 0 by N. J. A. Sloane, Feb 13 2015
The Mathematica programs are correct; b-file corrected by Harvey P. Dale, Feb 14 2015

A255051 a(1)=1, a(n+1) = a(n)/gcd(a(n),n) if this GCD is > 1, else a(n+1) = a(n) + n + 1.

Original entry on oeis.org

1, 3, 6, 2, 1, 7, 14, 2, 1, 11, 22, 2, 1, 15, 30, 2, 1, 19, 38, 2, 1, 23, 46, 2, 1, 27, 54, 2, 1, 31, 62, 2, 1, 35, 70, 2, 1, 39, 78, 2, 1, 43, 86, 2, 1, 47, 94, 2, 1, 51, 102, 2, 1, 55, 110, 2, 1, 59, 118, 2, 1, 63, 126, 2, 1, 67, 134, 2, 1, 71, 142, 2, 1
Offset: 1

Views

Author

M. F. Hasler, Feb 15 2015

Keywords

Comments

A somehow "trivial" variant of A133058 and A255140, both of which have very similar definitions, but enter 4-periodic loops only at later indices.
There could be two motivated values for an initial term: either a(0)=0 which would yield a(1)=1 and the following values via the recursion formula, or a(0)=2 according to the general formula for a(4k).

Examples

			a(2) = a(1)+2 = 3, a(3) = a(2)+3 = 6, a(4) = a(3)/3 = 2, a(5) = a(4)/2 = 1;
a(6) = a(5)+6 = 7, a(7) = a(6)+7 = 14, a(8) = a(7)/7 = 2, a(9) = a(8)/2 = 1; ...
		

Crossrefs

Programs

  • Magma
    &cat [[1, 4*n+3, 8*n+6, 2]: n in [0..20]]; // Bruno Berselli, Feb 16 2015
  • Mathematica
    Table[(2 (3 + (-1)^n) - (2 - 3 n + n (-1)^n) (1 - (-1)^((n - 1) n/2)))/4, {n, 1, 80}] (* Bruno Berselli, Feb 16 2015 *)
    nxt[{n_,a_}]:={n+1,If[GCD[a,n]>1,a/GCD[a,n],a+n+1]}; Transpose[ NestList[ nxt, {1,1},80]][[2]] (* or *) LinearRecurrence[{0,0,0,2,0,0,0,-1},{1,3,6,2,1,7,14,2},80] (* Harvey P. Dale, Oct 13 2015 *)
  • PARI
    (A255051_upto(N)=vector(N, n, if(gcd(N, n-1)>1, N\=gcd(N, n-1), N+=n)))(99) \\ simplified by M. F. Hasler, Jan 11 2020
    
  • PARI
    A255051(n)=if(n%4>1,if(bittest(n,0),n*2,n+1),2-bittest(n,0)) \\ M. F. Hasler, Feb 18 2015
    

Formula

a(4k+1) = 1, a(4k+2) = 4k+3, a(4k+3) = 2*a(4k+2) = 8k+6, a(4k) = 2.
G.f.: x*(1 + 3*x + 6*x^2 + 2*x^3 - x^4 + x^5 + 2*x^6 - 2*x^7)/((1 - x)^2*(1 + x)^2*(1 + x^2)^2). - Bruno Berselli, Feb 16 2015
a(n) = ( 2*(3 + (-1)^n) - (2 - 3*n + n*(-1)^n)*(1 - (-1)^((n-1)*n/2)) )/4. - Bruno Berselli, Feb 16 2015
Showing 1-10 of 26 results. Next