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

A191304 Records in A132199.

Original entry on oeis.org

1, 5, 11, 23, 47, 101, 233, 467, 941, 1889, 3779, 7559, 15131, 30323, 60647, 121403, 242807, 486041, 972533, 1945649, 3891467, 7783541, 15567089, 31139561, 62279171, 124559609, 249120239, 498270791, 996541661, 1993083437, 3986167223, 7972334723, 15944673761
Offset: 1

Views

Author

Robert G. Wilson v, Apr 30 2009

Keywords

Comments

Except for a(1)=1, log(a(n)) is nearly but not exactly linear. - Ralf Steiner, Aug 18 2017

Crossrefs

Programs

Formula

For all a(n) except a(1)=1 is 5 congruent mod 6, a(n+1) > 2 a(n) and lim_{n->inf} a(n+1)/a(n) = 2. - Ralf Steiner, Aug 18 2017

Extensions

a(23)-a(33) from Ralf Steiner, Aug 18 2017

A247090 Eric Rowland's generalization of A132199 as a rectangular array A read by upward antidiagonals.

Original entry on oeis.org

1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 2, 1, 1, 5, 3, 1, 1, 1, 1, 1, 1, 5, 3, 1, 1, 1, 1, 2, 1, 1, 5, 3, 1, 1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

L. Edson Jeffery, Nov 18 2014

Keywords

Comments

Conjecture [Rowland] (paraphrased): Let A be the above array with entry A(n,k) in row n and column k. For each n, there exists an index N(n) >= 1 such that A(n,j) is either 1 or prime for all j > N(n).

Examples

			Array A begins:
1, 1, 1, 1, 1, 1, 1, 1, 1,  1, 1,  1, ...
2, 1, 1, 1, 1, 1, 1, 1, 1,  1, 1,  1, ...
1, 1, 1, 1, 1, 1, 1, 1, 1,  1, 1,  1, ...
2, 3, 1, 5, 3, 1, 1, 1, 1, 11, 3,  1, ...
1, 3, 1, 5, 3, 1, 1, 1, 1, 11, 3,  1, ...
2, 1, 1, 5, 3, 1, 1, 1, 1, 11, 3,  1, ...
1, 1, 1, 5, 3, 1, 1, 1, 1, 11, 3,  1, ...
2, 1, 1, 1, 1, 7, 1, 1, 1,  1, 1, 13, ...
1, 1, 1, 1, 1, 7, 1, 1, 1,  1, 1, 13, ...
2, 3, 1, 1, 1, 1, 1, 1, 1, 11, 3,  1, ...
1, 3, 1, 1, 1, 1, 1, 1, 1, 11, 3,  1, ...
2, 1, 1, 1, 1, 1, 1, 1, 1, 11, 3,  1, ...
...
		

Crossrefs

Programs

  • Mathematica
    (* Array A: *)
    max := 13; b[n_, 1] := n; b[n_, k_] := b[n, k] = b[n, k - 1] + GCD[k, b[n, k - 1]]; Grid[Transpose[Differences[Transpose[Table[b[n, k], {n, max}, {k, max}]]]]]
    (* Array antidiagonals flattened: *)
    max := 13; b[n_, 1] := n; b[n_, k_] := b[n, k] = b[n, k - 1] + GCD[k, b[n, k - 1]]; Flatten[Table[Transpose[Differences[Transpose[Table[b[n, k], {n, max}, {k, max}]]]][[n - k + 1]][[k]], {n, max - 1}, {k, n}]]

A226781 Number of 1's in A132199 preceding the n-th Rowland prime, A137613(n).

Original entry on oeis.org

3, 3, 7, 7, 17, 17, 39, 39, 40, 40, 89, 89, 91, 95, 95, 100, 215, 215, 447, 447, 448, 448, 917, 917, 919, 1862, 1862, 3750, 3750, 7528, 7528, 7533, 15097, 15097, 15122, 15122, 15124, 30284, 30284, 60606, 60606, 60607, 60607, 60656, 60656, 121356, 121356
Offset: 1

Views

Author

Vladimir Shevelev, Jun 29 2013

Keywords

Comments

The length of the clusters of 1's in A132199 is 3, 0, 4, 0, 10, 0, 22, 0, 1, 0, 49,.. and this sequence here are the partial sums of these lengths.

Crossrefs

Programs

  • Maple
    cd1 := 0 ;
    for i from 1 do
        if A132199(i) = 1 then
            cd1 := cd1+1 ;
        else
            printf("%d,\n",cd1) ;
        end if;
    end do: # R. J. Mathar, Jul 04 2013

A106108 Rowland's prime-generating sequence: a(1) = 7; for n > 1, a(n) = a(n-1) + gcd(n, a(n-1)).

Original entry on oeis.org

7, 8, 9, 10, 15, 18, 19, 20, 21, 22, 33, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 69, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 141, 144, 145, 150, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168
Offset: 1

Views

Author

N. J. A. Sloane, Jan 28 2008

Keywords

Comments

The title refers to the sequence of first differences, A132199.
Setting a(1) = 4 gives A084662.
Rowland proves that the first differences are all 1's or primes. The prime differences form A137613.
See A137613 for additional comments, links and references. - Jonathan Sondow, Aug 14 2008
Not all starting values generate differences of all 1's or primes. The following a(1) generate composite differences: 532, 533, 534, 535, 698, 699, 706, 707, 708, 709, 712, 713, 714, 715, ... - Dmitry Kamenetsky, Jul 18 2015
The same results are obtained if 2's are removed from n when gcd is performed, so the following is also true: a(1) = 7; for n > 1, a(n) = a(n-1) + gcd(A000265(n), a(n-1)). - David Morales Marciel, Sep 14 2016

References

  • Eric S. Rowland, A simple prime-generating recurrence, Abstracts Amer. Math. Soc., 29 (No. 1, 2008), p. 50 (Abstract 1035-11-986).

Crossrefs

Programs

  • Haskell
    a106108 n = a106108_list !! (n-1)
    a106108_list =
       7 : zipWith (+) a106108_list (zipWith gcd a106108_list [2..])
    -- Reinhard Zumkeller, Nov 15 2013
    
  • Magma
    [n le 1 select 7 else Self(n-1) + Gcd(n, Self(n-1)): n in [1..70]]; // Vincenzo Librandi, Jul 19 2015
    
  • Maple
    S:=7; f:= proc(n) option remember; global S; if n=1 then RETURN(S); else RETURN(f(n-1)+gcd(n,f(n-1))); fi; end; [seq(f(n),n=1..200)];
  • Mathematica
    a[1] = 7; a[n_] := a[n] = a[n - 1] + GCD[n, a[n - 1]]; Array[a, 66] (* Robert G. Wilson v, Sep 10 2008 *)
  • PARI
    a=vector(100);a[1]=7;for(n=2,#a,a[n]=a[n-1]+gcd(n,a[n-1]));a \\ Charles R Greathouse IV, Jul 15 2011
    
  • Python
    from itertools import count, islice
    from math import gcd
    def A106108_gen(): # generator of terms
        yield (a:=7)
        for n in count(2):
            yield (a:=a+gcd(a,n))
    A106108_list = list(islice(A106108_gen(),20)) # Chai Wah Wu, Mar 14 2023

A166945 Records of first differences of A166944.

Original entry on oeis.org

2, 3, 7, 13, 43, 139, 313, 661, 1321, 2659, 5419, 10891, 22039, 44383, 88801, 177841, 355723, 713833, 1427749, 2860771, 5725453, 11461141, 22933441, 45895573, 91793059, 183616423, 367232911, 734482123, 1468965061, 2937930211, 5875882249, 11751795061, 23503590559, 47007181621, 94014363763
Offset: 1

Views

Author

Vladimir Shevelev, Oct 24 2009, Nov 05 2009

Keywords

Comments

Conjecture. Each term of the sequence is the greater of a pair of twin primes (A006512).

Crossrefs

Programs

  • Mathematica
    Reap[Print[old = r = 2]; Sow[old]; For[n = 2, n <= 10^6, n++, d = GCD[old, If[OddQ[n], n-2, n]]; If[d>r, r=d; Print[d]; Sow[d]]; old += d]][[2, 1]] (* Jean-François Alcover, Nov 03 2018, from PARI *)
  • PARI
    print1(old=r=2); for(n=2,1e11, d=gcd(old,if(n%2,n-2,n)); if(d>r, r=d; print1(", "d)); old+=d) \\ Charles R Greathouse IV, Oct 13 2017

Extensions

6 more terms from R. J. Mathar, Nov 19 2009; extension beginning with a(19) from Benoit Cloitre (private communication to Vladimir Shevelev)
a(25), a(26) from D. S. McNeil, Dec 13 2010
a(27)-a(30) from Charles R Greathouse IV, Oct 13 2017
a(31)-a(35) from Charles R Greathouse IV, Oct 17 2017

A116533 a(1)=1, a(2)=2, for n > 2 if a(n-1) is prime, then a(n) = 2*a(n-1), otherwise a(n) = a(n-1) - 1.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 10, 9, 8, 7, 14, 13, 26, 25, 24, 23, 46, 45, 44, 43, 86, 85, 84, 83, 166, 165, 164, 163, 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, 634, 633, 632, 631, 1262, 1261, 1260, 1259, 2518, 2517, 2516, 2515, 2514, 2513, 2512, 2511, 2510, 2509, 2508
Offset: 1

Views

Author

Rodolfo Kurchan, Mar 26 2006

Keywords

Comments

For n >= 3, using Wilson's theorem, a(n) = a(n-1) + (-1)^r*gcd(a(n-1), W), where W = A038507(a(n-1) - 1), and r=1 if gcd(a(n-1), W) = 1 and r=0 otherwise. - Vladimir Shevelev, Aug 07 2009

Crossrefs

Programs

  • Maple
    a[1]:=1: a[2]:=2: for n from 3 to 60 do if isprime(a[n-1])=true then a[n]:=2*a[n-1] else a[n]:=a[n-1]-1 fi od: seq(a[n],n=1..60); # Emeric Deutsch, Apr 02 2006

Extensions

More terms from Emeric Deutsch, Apr 02 2006

A163961 First differences of A116533.

Original entry on oeis.org

1, 2, -1, 3, -1, 5, -1, -1, -1, 7, -1, 13, -1, -1, -1, 23, -1, -1, -1, 43, -1, -1, -1, 83, -1, -1, -1, 163, -1, -1, -1, -1, -1, -1, -1, -1, -1, 317, -1, -1, -1, 631, -1, -1, -1, 1259, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2503, -1, -1, -1, 5003, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Offset: 1

Views

Author

Vladimir Shevelev, Aug 07 2009, Aug 14 2009

Keywords

Comments

Ignoring the +-1 terms, we obtain the sequence of Bertrand's primes A006992. If we consider sequences A_i={a_i(n)}, i=1,2,... with the same constructions as A116533, but with initials a_1(1)=2, a_2(1)=11, a_3(1)=17,..., a_m(1)=A164368(m),..., then the union of A_1,A_2,... contains all primes.

Crossrefs

Programs

  • Maple
    A116533 := proc(n) option remember; if n <=2 then n; else if isprime(procname(n-1)) then 2*procname(n-1) ; else procname(n-1)-1 ; end if; end if; end proc:
    A163961 := proc(n) A116533(n+1)-A116533(n) ; end proc: # R. J. Mathar, Sep 03 2011
  • Mathematica
    Differences@ Prepend[NestList[If[PrimeQ@ #, 2 #, # - 1] &, 2, 90], 1] (* Michael De Vlieger, Dec 06 2018 *)
  • PARI
    a116533(n) = if(n==1, 1, if(n==2, 2, if(ispseudoprime(a116533(n-1)), 2*a116533(n-1), a116533(n-1)-1)))
    a(n) = a116533(n+1)-a116533(n) \\ Felix Fröhlich, Dec 06 2018
    
  • PARI
    lista(nn) = {va = vector(nn); va[1] = 1; va[2] = 2; for (n=3, nn, va[n] = if (isprime(va[n-1]), 2*va[n-1], va[n-1]-1);); vector(nn-1, n, va[n+1] - va[n]);} \\ Michel Marcus, Dec 07 2018

A163963 First differences of A080735.

Original entry on oeis.org

1, 2, 1, 5, 1, 11, 1, 23, 1, 47, 1, 1, 1, 97, 1, 1, 1, 197, 1, 1, 1, 397, 1, 1, 1, 797, 1, 1, 1, 1597, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3203, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6421, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12853, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 25717, 1, 1, 1, 51437, 1, 1, 1
Offset: 1

Views

Author

Vladimir Shevelev, Aug 07 2009

Keywords

Comments

Ignoring the 1 terms we obtain A055496. If we consider sequences A_i={a_i(n)}, i=1,2,... with the same constructions as A080735, but with initials a_1(1)=2, a_2(1)=3, a_3(1)=13,..., a_m(1)=A080359(m),..., then the union of A_1,A_2,... contains all primes.

Crossrefs

Programs

  • Maple
    A080735 := proc(n) option remember; local p ; if n = 1 then 1; else p := procname(n-1) ; if isprime(p) then 2*p; else p+1 ; end if; end if; end proc: A163963 := proc(n) A080735(n+1)-A080735(n) ; end: seq(A163963(n),n=1..100) ; # R. J. Mathar, Nov 05 2009
  • Mathematica
    Differences@ NestList[If[PrimeQ@ #, 2 #, # + 1] &, 1, 87] (* Michael De Vlieger, Dec 06 2018, after Harvey P. Dale at A080735 *)
  • PARI
    lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = if (isprime(va[n-1]), 2*va[n-1], va[n-1]+1);); vector(nn-1, n, va[n+1] - va[n]);} \\ Michel Marcus, Dec 06 2018

Extensions

More terms from R. J. Mathar, Nov 05 2009

A166944 a(1)=2; a(n) = a(n-1) + gcd(n, a(n-1)) if n is even, a(n) = a(n-1) + gcd(n-2, a(n-1)) if n is odd.

Original entry on oeis.org

2, 4, 5, 6, 9, 12, 13, 14, 21, 22, 23, 24, 25, 26, 39, 40, 45, 54, 55, 60, 61, 62, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 129, 130, 135, 138, 139, 140, 147, 148, 149, 150, 151, 152, 153, 154, 155, 160, 161, 162, 163
Offset: 1

Views

Author

Vladimir Shevelev, Oct 24 2009

Keywords

Comments

Conjecture: Every record of differences a(n)-a(n-1) more than 5 is the greater of twin primes (A006512).

Crossrefs

Programs

  • Maple
    A166944 := proc(n) option remember; if n = 1 then 2; else p := procname(n-1) ; if type(n,'even') then p+igcd(n,p) ; else p+igcd(n-2,p) ; end if; end if; end proc: # R. J. Mathar, Sep 03 2011
  • Mathematica
    nxt[{n_,a_}]:={n+1,If[OddQ[n],a+GCD[n+1,a],a+GCD[n-1,a]]}; Transpose[ NestList[ nxt,{1,2},70]][[2]] (* Harvey P. Dale, Feb 10 2015 *)
  • PARI
    print1(a=2); for(n=2, 100, d=gcd(a, if(n%2, n-2, n)); print1(", "a+=d)) \\ Charles R Greathouse IV, Oct 13 2017

Extensions

Terms beginning with a(18) corrected by Vladimir Shevelev, Nov 10 2009

A137613 Omit the 1's from Rowland's sequence f(n) - f(n-1) = gcd(n,f(n-1)), where f(1) = 7.

Original entry on oeis.org

5, 3, 11, 3, 23, 3, 47, 3, 5, 3, 101, 3, 7, 11, 3, 13, 233, 3, 467, 3, 5, 3, 941, 3, 7, 1889, 3, 3779, 3, 7559, 3, 13, 15131, 3, 53, 3, 7, 30323, 3, 60647, 3, 5, 3, 101, 3, 121403, 3, 242807, 3, 5, 3, 19, 7, 5, 3, 47, 3, 37, 5, 3, 17, 3, 199, 53, 3, 29, 3, 486041, 3, 7, 421, 23
Offset: 1

Views

Author

Jonathan Sondow, Jan 29 2008, Jan 30 2008

Keywords

Comments

Rowland proves that each term is prime. He says it is likely that all odd primes occur.
In the first 5000 terms, there are 965 distinct primes and 397 is the least odd prime that does not appear. - T. D. Noe, Mar 01 2008
In the first 10000 terms, the least odd prime that does not appear is 587, according to Rowland. - Jonathan Sondow, Aug 14 2008
Removing duplicates from this sequence yields A221869. The duplicates are A225487. - Jonathan Sondow, May 03 2013

Examples

			f(n) = 7, 8, 9, 10, 15, 18, 19, 20, ..., so f(n) - f(n-1) = 1, 1, 1, 5, 3, 1, 1, ... and a(n) = 5, 3, ... .
From _Vladimir Shevelev_, Mar 03 2010: (Start)
  a(1) = Lpf(6-1) = 5;
  a(2) = Lpf(6-2+5) = 3;
  a(3) = Lpf(6-3+5+3) = 11;
  a(4) = Lpf(6-4+5+3+11) = 3;
  a(5) = Lpf(6-5+5+3+11+3) = 23. (End)
		

Crossrefs

f(n) = f(n-1) + gcd(n, f(n-1)) = A106108(n) and f(n) - f(n-1) = A132199(n-1).

Programs

  • Haskell
    a137613 n = a137613_list !! (n-1)
    a137613_list =  filter (> 1) a132199_list
    -- Reinhard Zumkeller, Nov 15 2013
    
  • Maple
    A137613_list := proc(n)
    local a, c, k, L;
    L := NULL; a := 7;
    for k from 2 to n do
        c := igcd(k,a);
        a := a + c;
        if c > 1 then L:=L,c fi;
    od;
    L end:
    A137613_list(500000); # Peter Luschny, Nov 17 2011
  • Mathematica
    f[1] = 7; f[n_] := f[n] = f[n - 1] + GCD[n, f[n - 1]]; DeleteCases[Differences[Table[f[n], {n, 10^6}]], 1] (* Alonso del Arte, Nov 17 2011 *)
  • PARI
    ub=1000; n=3; a=9; while(nDaniel Constantin Mayer, Aug 31 2014
    
  • Python
    from itertools import count, islice
    from math import gcd
    def A137613_gen(): # generator of terms
        a = 7
        for n in count(2):
            if (b:=gcd(a,n)) > 1: yield b
            a += b
    A137613_list = list(islice(A137613_gen(),20)) # Chai Wah Wu, Mar 14 2023

Formula

Denote by Lpf(n) the least prime factor of n. Then a(n) = Lpf( 6-n+Sum_{i=1..n-1} a(i) ). - Vladimir Shevelev, Mar 03 2010
a(n) = A168008(2*n+4) (conjectured). - Jon Maiga, May 20 2021
a(n) = A020639(A190894(n)). - Seiichi Manyama, Aug 11 2023
Showing 1-10 of 26 results. Next