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.

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

A132199 Rowland's prime-generating sequence: first differences of A106108.

Original entry on oeis.org

1, 1, 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

Comments

Rowland shows that the terms are all 1's or primes.
The prime terms form A137613.
See A137613 for additional comments, links and references. - Jonathan Sondow, Aug 14 2008
From Robert G. Wilson v, Apr 30 2009: (Start)
First appearance of k-th prime, k >= 0: 1, 0, 5, 4, 104, 10, 116, 242878, 242819, 22, 243019, 3891770, 242867, ..., .
The number of different numbers in the first 10^k terms beginning with k=0: 1, 4, 7, 12, 15, 19, 30, >35, ..., .
Record high values are A191304. (End)

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. A106108, A137613, A134734, A134743, A134744, A191304 (record highs) A247090. See A106108 for other cross-references.

Programs

  • Haskell
    a132199 n = a132199_list !! (n-1)
    a132199_list = zipWith (-) (tail a106108_list) a106108_list
    -- Reinhard Zumkeller, Nov 15 2013
    
  • Maple
    A106108 := proc(n)
        option remember;
        if n = 1 then
            7;
        else
            procname(n-1)+igcd(n,procname(n-1)) ;
        end if;
    end proc:
    A132199 := proc(n)
        A106108(n+1)-A106108(n) ;
    end proc: # R. J. Mathar, Jul 04 2013
  • Mathematica
    a[1] = 7; a[n_] := a[n] = a[n - 1] + GCD[n, a[n - 1]]; t = Array[a, 104]; Rest@t - Most@t (* Robert G. Wilson v, Apr 30 2009 *)
  • PARI
    ub=1000; a=7; n=2; while(nDaniel Constantin Mayer, Aug 31 2014
    
  • Python
    from itertools import count, islice
    from math import gcd
    def A132199_gen(): # generator of terms
        a = 7
        for n in count(2):
            yield (b:=gcd(a,n))
            a += b
    A132199_list = list(islice(A132199_gen(),20)) # Chai Wah Wu, Mar 14 2023

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

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

A134744 First differences of A084663.

Original entry on oeis.org

2, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 13, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 29, 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, 59, 3, 1, 1, 7, 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
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

Cf. A084663. See A106108 for other cross-references.

Programs

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

A134736 a(1) = 5; for n >1, a(n) = a(n-1) + gcd(n, a(n-1)).

Original entry on oeis.org

5, 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

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.
Cf. A230504, A134743 (first differences), A084662, A084663.

Programs

  • Haskell
    a134736 n = a134736_list !! (n-1)
    a134736_list =
       5 : zipWith (+) a134736_list (zipWith gcd a134736_list [2..])
    -- Reinhard Zumkeller, Nov 15 2013
  • Mathematica
    a[1] = 5; a[n_] := a[n] = a[n-1] + GCD[n, a[n-1]];
    Array[a, 66] (* Jean-François Alcover, Oct 01 2018 *)
    RecurrenceTable[{a[1]==5,a[n]==a[n-1]+GCD[n,a[n-1]]},a,{n,70}] (* Harvey P. Dale, Nov 24 2018 *)

A134745 Numbers which are not permutational numbers A134640.

Original entry on oeis.org

3, 4, 6, 8, 9, 10, 12, 13, 14, 16, 17, 18, 20, 22, 23, 24, 25, 26, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 76, 77, 79, 80, 81, 82, 83, 84, 85, 86, 87
Offset: 1

Views

Author

Artur Jasinski, Nov 07 2007

Keywords

Crossrefs

Programs

  • Mathematica
    a = {}; b = {}; Do[AppendTo[b, n]; w = Permutations[b]; Do[j = FromDigits[w[[m]], n + 1]; AppendTo[a, j], {m, 1, Length[w]}], {n, 0, 5}]; c = Table[n, {n, 0, 44790}]; k = Complement[c, a] (*Artur Jasinski*)
Showing 1-7 of 7 results.