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 23 results. Next

A134734 First differences of A084662.

Original entry on oeis.org

2, 3, 1, 5, 3, 1, 1, 1, 1, 11, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 23, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 47, 3, 1, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 101, 3, 1, 1
Offset: 1

Views

Author

N. J. A. Sloane, Jan 28 2008

Keywords

References

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

Crossrefs

See A106108 for other cross-references.

Programs

  • Haskell
    a134734 n = a134734_list !! (n-1)
    a134734_list = zipWith (-) (tail a084662_list) a084662_list
    -- Reinhard Zumkeller, Nov 15 2013
  • Mathematica
    b[1] = 4; b[n_] := b[n] = b[n-1] + GCD[n, b[n-1]];
    Table[b[n], {n, 104}] // Differences (* Jean-François Alcover, Sep 28 2018 *)

Formula

a(n) = A132199(n), n > 2. - R. J. Mathar, Mar 28 2012

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

A084663 a(1) = 8; a(n) = a(n-1) + gcd(a(n-1), n).

Original entry on oeis.org

8, 10, 11, 12, 13, 14, 21, 22, 23, 24, 25, 26, 39, 40, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 177, 180, 181, 182, 189, 190
Offset: 1

Views

Author

Matthew Frank (mfrank(AT)wopr.wolfram.com) on behalf of the 2003 New Kind of Science Summer School, Jul 15 2003

Keywords

Comments

The first 150000000 differences are all primes or 1. Is this true in general?
The proof of the conjecture is identical to the proof in the Rowland link. - Yifan Xie, Apr 11 2025

References

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

Crossrefs

Cf. A230504, A134744 (first differences), A134736.

Programs

  • Haskell
    a084663 n = a084663_list !! (n-1)
    a084663_list =
       8 : zipWith (+) a084663_list (zipWith gcd a084663_list [2..])
    -- Reinhard Zumkeller, Nov 15 2013
    
  • Maple
    S := 8; f := proc(n) option remember; global S; if n=1 then S else f(n-1)+igcd(n,f(n-1)); fi; end;
  • Mathematica
    a[n_]:= a[n]= If[n==1,8, a[n-1] + GCD[n, a[n-1]]]; Table[a[n], {n,70}]
    RecurrenceTable[{a[1]==8,a[n]==a[n-1]+GCD[a[n-1],n]},a,{n,70}] (* Harvey P. Dale, Apr 12 2016 *)
  • SageMath
    @CachedFunction
    def a(n): # a = A084663
        if (n==1): return 8
        else: return a(n-1) + gcd(a(n-1), n)
    [a(n) for n in range(1, 71)] # G. C. Greubel, Mar 22 2023

A134162 Let S(k) be the sequence s() defined by s(1) = k; for i > 1, s(i) = s(i-1) + gcd(s(i-1), i). Start with the list of positive integers and remove any k's for which S(k) merges with an S(m) with m < k. Each value k > 1 is conjectural.

Original entry on oeis.org

1, 2, 4, 8, 16, 20, 44, 92, 110, 136, 152, 170, 172, 188, 200, 212, 236, 242, 256, 272, 316, 332, 368, 440, 488, 500, 590, 616, 620, 632, 650, 676, 704, 710, 742, 788, 824, 848, 892, 946, 952, 968, 1010, 1034, 1036, 1052, 1058, 1088, 1118
Offset: 1

Views

Author

Eric Rowland, Jan 29 2008

Keywords

Comments

For the given initial values k, it is conjectural that their sequences S(k) never merge. The S(k) have been checked to be distinct for 2^60 terms (see Rowland link), but it is possible that they merge later on.

Examples

			From _Danny Rorabaugh_, Apr 02 2015: (Start)
S(1) = A000027 is the positive integers.
S(2) = [2,4,5,...,i+2,...].
S(3) = [3,4,5,...,i+2,...] merges with S(2) at index 2.
S(4) = [4,6,9,10,15,18,19,20,21,22,33,...] = A084662.
S(5) = [5,6,9,...] = A134736 merges with S(4) at index 2.
(End)
		

Crossrefs

Cf. A000027 (S(1)), A084662 (S(4)), A134736 (S(5)), A106108 (S(7)), A084663 (S(8)).
Cf. A106108 for other Crossrefs.

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

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

A167053 a(1)=3; for n > 1, a(n) = 1 + a(n-1) + gcd( a(n-1)*(a(n-1)+2), A073829(a(n-1)) ).

Original entry on oeis.org

3, 19, 39, 81, 165, 333, 335, 673, 1347, 1349, 1351, 1353, 1355, 1357, 1359, 2721, 2723, 2725, 2727, 5457, 5459, 5461, 5463, 5465, 5467, 5469, 10941, 10943, 10945, 10947, 21897, 21899, 21901, 21903, 21905, 21907, 21909, 43821, 43823, 43825, 43827, 43829, 43831
Offset: 1

Views

Author

Vladimir Shevelev, Oct 27 2009

Keywords

Comments

The first differences are 16, 20, 42, etc. They are either 2 or in A075369 or in A008864, see A167054.
A proof follows from Clement's criterion of twin primes.

Examples

			a(2) = 1 + 3 + gcd(3*5, 4*(2! + 1) + 3) = 19.
		

References

  • E. Trost, Primzahlen, Birkhäuser-Verlag, 1953, pages 30-31.

Crossrefs

Programs

  • Maple
    A073829 := proc(n) n+4*((n-1)!+1) ; end proc:
    A167053 := proc(n) option remember ; local aprev; if n = 1 then 3; else aprev := procname(n-1) ; 1+aprev+gcd(aprev*(aprev+2),A073829(aprev)) ; end if; end proc:
    seq(A167053(n),n=1..60) ; # R. J. Mathar, Dec 17 2009
  • Mathematica
    A073829[n_] := 4((n-1)! + 1) + n;
    a[1] = 3;
    a[n_] := a[n] = 1 + a[n-1] + GCD[a[n-1] (a[n-1] + 2), A073829[a[n-1]]];
    Array[a, 60] (* Jean-François Alcover, Mar 25 2020 *)

Extensions

Definition shortened and values from a(4) on replaced by R. J. Mathar, Dec 17 2009

A167168 Sequence of prime gaps which characterize Rowland sequences of prime-generating recurrences.

Original entry on oeis.org

3, 7, 17, 19, 31, 43, 53, 67, 71, 79, 97, 103, 109, 113, 127, 137, 151, 163, 173, 181, 191, 197, 199, 211, 229, 239, 241, 251, 257, 269, 271, 283, 293, 317, 331, 337, 349, 367, 373
Offset: 1

Views

Author

Vladimir Shevelev, Oct 29 2009

Keywords

Comments

Consider the Rowland sequences with recurrence N(n)= N(n-1)+gcd(n,N(n-1)).
For some of these, like the prototypical A106108, the first differences N(n)-N(n-1) are always 1 or primes.
If for some position p (a prime) N(p-1)=2*p, then the arXiv preprint shows that N is indeed in that class of prime-generating sequences.
Since then N(p)=N(p-1)+p, the prime p characterizes at the same time the gap (first difference) and location in the sequence.
In the same sequence at some larger value of p, we may again have N(p-1)=2*p. In these cases, we put all these p's satisfying that equation into a generator class.
For each of the generator classes, the OEIS sequence shows the smallest member (prime) in that class. So this is a trace of how many essentially different sequences with this N(p-1)=2*p property exist.

Examples

			We put a(1)=3 since the N-sequence 4, 6, 9, 10, 15, 18, 19, 20.. = A084662 (essentially the same as A106108) has a first difference of p=3 at position p-1=2, N(2)=2*3.
It has a first difference of p=5 at p-1=4, a first difference of p=11 at p=10, so we put {3,5,11,23,..} into that class. This leaves p=7=a(2) as the lowest prime to be covered by the next class. This is first realized by N = 8, 10, 11, 12, 13, 14, 21, 22, 23, 24, 25, 26, 39.. = A084663. Here N(12)=2*13, so p=13 is in the same class as p=7, namely {7,13,29,59,131,..}. This leaves p=17=a(3) to be the smallest member in a new class, namely {17,41,83,167,..}.
		

Crossrefs

Extensions

Edited, a(1) set to 3, 37 replaced by 31, and extended beyond 53 by R. J. Mathar, Dec 17 2009

A167054 Values of A167053(k)-A167053(k-1)-1 not equal to 1.

Original entry on oeis.org

15, 19, 41, 83, 167, 337, 673, 1361, 2729, 5471, 10949, 21911, 43853, 87719, 175447, 350899, 701819, 1403641, 2807303, 5614657, 11229331, 22458671, 44917381, 89834777, 179669557, 359339171, 718678369
Offset: 1

Views

Author

Vladimir Shevelev, Oct 27 2009

Keywords

Comments

All terms of the sequence are primes or products of twin primes (A037074).

Crossrefs

Extensions

Values from a(3) on replaced by R. J. Mathar, Dec 17 2009
More terms from Amiram Eldar, Sep 13 2019
Showing 1-10 of 23 results. Next