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

A134743 First differences of A134736.

Original entry on oeis.org

1, 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
    a134743 n = a134743_list !! (n-1)
    a134743_list = zipWith (-) (tail a134736_list) a134736_list
    -- Reinhard Zumkeller, Nov 15 2013
  • Mathematica
    b[1] = 5; b[n_] := b[n] = b[n-1] + GCD[n, b[n-1]];
    Array[b, 104] // Differences (* Jean-François Alcover, Oct 01 2018 *)

Formula

a(n) = A132199(n), n>2. [R. J. Mathar, Dec 13 2008]

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

A084662 a(1) = 4; a(n) = a(n-1) + gcd(a(n-1), n).

Original entry on oeis.org

4, 6, 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

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

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

Cf. A084663, A106108 and other sequences mentioned in A106108.
Cf. A134734 (first differences), A134736, A230504.

Programs

  • Haskell
    a084662 n = a084662_list !! (n-1)
    a084662_list =
       4 : zipWith (+) a084662_list (zipWith gcd a084662_list [2..])
    -- Reinhard Zumkeller, Nov 15 2013
    
  • Magma
    [n eq 1 select 4 else Self(n-1)+Gcd(Self(n-1),n): n in [1..66]]; // Bruno Berselli, May 24 2011
    
  • Maple
    S := 4; 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[1]= 4; a[n_]:= a[n]= a[n-1] + GCD[n, a[n-1]]; Table[a[n], {n, 70}]
    nxt[{n_, a_}]:= {n+1, a + GCD[a, n+1]}; NestList[nxt,{1,4},70][[All,2]] (* Harvey P. Dale, Dec 25 2018 *)
  • Maxima
    a[1]:4$ a[n]:=a[n-1]+gcd(a[n-1],n)$ makelist(a[n], n, 1, 66); /* Bruno Berselli, May 24 2011 */
    
  • SageMath
    @CachedFunction
    def a(n): # a = A084662
        if (n==1): return 4
        else: return a(n-1) + gcd(a(n-1), n)
    [a(n) for n in range(1,71)] # G. C. Greubel, Mar 22 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.

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

A230504 Smallest prime in r(k) = r(k-1) + gcd(k,r(k-1)) with r(1) = n.

Original entry on oeis.org

2, 2, 3, 19, 5, 19, 7, 11, 11, 17, 11, 17, 13, 17, 17, 23, 17, 23, 19, 23, 23, 29, 23, 29, 29, 29, 29, 37, 29, 37, 31, 37, 37, 53, 53, 53, 37, 41, 41, 47, 41, 47, 43, 47, 47, 53, 47, 53, 53, 53, 53, 59, 53, 59, 59, 59, 59, 67, 59, 67, 61, 67, 67, 79, 79, 79
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 15 2013

Keywords

Comments

a(p) = p, p prime;
a(2*n-1) = A060264(n-1).

Examples

			n = 1 -> 1 + GCD(1,2) = 1+1 = 2 = prime(1) = a(1);
n = 2 = prime(1) = a(2);
n = 3 = prime(2) = a(3);
n = 4 -> 4+GCD(4,2) = 4+2 = 6 -> 6+GCD(6,3) = 6+3 = 9 -> 9+GCD(9,4) = 9+1 = 10 -> 10+GCD(10,5) = 10+5 = 15 -> 15+GCD(15,6) = 15+3 = 18 -> 18+GCD(18,7) = 18+1 = 19 = prime(8) = a(4) = A084662(7);
n = 5 = prime(3) = a(5) = A134736(1);
n = 6 -> 6+GCD(6,2) = 6+2 = 8 -> 8+GCD(8,3) = 8+1 = 9 -> 9+GCD(9,4) = 9+1 = 10 -> 10+GCD(10,5) = 10+5 = 15 -> 15+GCD(15,6) = 15+3 = 18 -> 18+GCD(18,7) = 18+1 = 19 = prime(8) = a(6);
n = 7 = prime(4) = a(7) = A106108(1);
n = 8 -> 8+GCD(8,2) = 8+2 = 10 -> 10+GCD(10,3) = 10+1 = 11 = prime(5) = a(8) = A084663(3);
n = 9 -> 9+GCD(9,2) = 9+2 = 11 = prime(5) = a(9);
n = 10 -> 10+GCD(10,2) = 10+2 = 12 -> 12+GCD(12,3) = 12+3 = 15 -> 15+GCD(15,4) = 15+1 = 16 -> 16+GCD(16,5) = 16+1 = 17 = prime(7) = a(10);
n = 11 = prime(5) = a(11);
n = 12 -> 12+GCD(12,2) = 12+2 = 14 -> 14+GCD(14,3) = 14+1 = 15 -> 15+GCD(15,4) = 15+1 = 16 -> 16+GCD(16,5) = 16+1 = 17 = prime(7) = a(10).
		

Crossrefs

Programs

  • Haskell
    a230504 n = head $ filter ((== 1) . a010051') rs where
                       rs = n : zipWith (+) rs (zipWith gcd rs [2..])
    
  • Mathematica
    a[n_] := Module[{r}, If[PrimeQ[n], n, r[1]=n; r[k_] := r[k] = r[k-1] + GCD[k, r[k-1]]; For[k=1, True, k++, If[PrimeQ[r[k]], Return[r[k]]]]]];
    Array[a, 66] (* Jean-François Alcover, Dec 03 2018 *)
  • Python
    from math import gcd
    from itertools import count, accumulate
    from sympy import isprime
    def A230504(n): return next(filter(isprime,accumulate(count(2),lambda x,y:x+gcd(x,y),initial=n))) # Chai Wah Wu, Mar 15 2023
Showing 1-7 of 7 results.