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

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

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

A190894 Auxiliary c(n) sequence used to prove some properties about Rowland's sequence. c(n) has the following recursive definition: c(1) = 5, c_(n+1) = c(n) + lfp(c(n)) - 1, where lpf(.) denotes the lowest prime factor of a number.

Original entry on oeis.org

5, 9, 11, 21, 23, 45, 47, 93, 95, 99, 101, 201, 203, 209, 219, 221, 233, 465, 467, 933, 935, 939, 941, 1881, 1883, 1889, 3777, 3779, 7557, 7559, 15117, 15119, 15131, 30261, 30263, 30315, 30317, 30323, 60645, 60647, 121293, 121295, 121299, 121301, 121401
Offset: 1

Views

Author

Serafín Ruiz-Cabello, May 23 2011

Keywords

Comments

This sequence is matched with r(n)=A190895(n). Rowland's sequence (A106108) can be easily described in terms of c(n) and r(n). Also, they can be used to prove easily that the difference between two consecutive terms is always 1 or a prime.
This sequence is related to Rowland's sequence (A106108) with initial condition a(1)=7. For any other odd initial condition a(1) greater than 3, there is an analog c(n) sequence, with c(1) = a(1) - 2.
Sequence r(n) satisfies 2r(n) - 1 = c(n), for any n>1.
For further information, see the references.

Examples

			For n=2, c(n) = 5 + lpf(5) - 1 = 5 + 5 - 1 = 9
For n=3, c(n) = 9 + lfp(9) - 1 = 9 + 3 - 1 = 11
		

Crossrefs

Programs

  • Mathematica
    NestList[#+FactorInteger[#][[1,1]]-1&,5,50] (* Harvey P. Dale, Jun 10 2016 *)

Formula

c(1) = 5; c(n+1) = c(n) + lfp(c(n)) - 1.

A221869 New primes found by Rowland's recurrence in the order of their appearance.

Original entry on oeis.org

5, 3, 11, 23, 47, 101, 7, 13, 233, 467, 941, 1889, 3779, 7559, 15131, 53, 30323, 60647, 121403, 242807, 19, 37, 17, 199, 29, 486041, 421, 972533, 577, 1945649, 163, 3891467, 127, 443, 31, 7783541, 15567089, 5323, 31139561, 41, 62279171, 83, 1103, 124559609
Offset: 1

Views

Author

Bill McEachen, Apr 10 2013

Keywords

Comments

The terms up to 1103 required examining numbers produced by Rowland's recurrence up to n = 10^8. - T. D. Noe, Apr 11 2013
Exactly 177789368686545736460055960459780707068552048703463291 iterations to find the first 1000 terms of this sequence. - T. D. Noe, Apr 13 2013
The first 10^100 terms of Rowland's sequence generate 18321 primes, 3074 of which are distinct. - Giovanni Resta, Apr 08 2016
Same as A137613 with duplicates deleted; same as A132199 with 1s and duplicates deleted. - Jonathan Sondow, May 03 2013

Examples

			b(5)-b(4) = 15-10 = 5, so a(1)=5.
b(6)-b(5) = 18-15 = 3, so a(2)=3.
b(11)-b(10) = 33-22 =11, so a(3)=11.
		

Crossrefs

Programs

  • Haskell
    import Data.Set (singleton, member, insert)
    a221869 n = a221869_list !! (n-1)
    a221869_list = f 2 7 (singleton 1) where
       f u v s | d `member` s = f (u + 1) (v + d) s
               | otherwise    = d : f (u + 1) (v + d) (d `insert` s)
               where d = gcd u v
    -- Reinhard Zumkeller, Nov 15 2013
  • Mathematica
    t = {}; b1 = 7; Do[b0 = b1; b1 = b0 + GCD[n, b0]; d = b1 - b0; If[d > 1 && !MemberQ[t, d], AppendTo[t, d]], {n, 2, 10^6}]; t (* T. D. Noe, Apr 10 2013 *)
    Rest[ DeleteDuplicates[ f[1] = 7; f[n_] := f[n] = f[n - 1] + GCD[n, f[n - 1]]; Differences[ Table[ f[n], {n, 10^6}]]]] (* Jonathan Sondow, May 03 2013 *)

Formula

Entries stem from new adjacent differences b(n) = b(n - 1) + GCD(n, b(n - 1)) where b(1)=7.

Extensions

More terms from T. D. Noe, Apr 11 2013
Edited by N. J. A. Sloane, Apr 12 2013 at the suggestion of Eric Rowland.

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

A225487 Duplicate primes found by Rowland's recurrence in the order of their reappearance.

Original entry on oeis.org

3, 5, 11, 7, 13, 101, 47, 53, 23, 19, 29, 37, 31, 41, 83, 73, 17, 43, 67, 157, 179, 167, 79, 443, 139, 113, 137, 97, 233, 61, 823, 71, 103, 151, 199, 499, 181, 229, 353, 313, 1889, 271, 317, 197, 613, 607, 127, 257, 89, 367, 223, 433, 239, 911, 109, 107, 557
Offset: 1

Views

Author

Jonathan Sondow, May 08 2013

Keywords

Comments

Among the first 10^8 terms of A132199 (Rowland's sequence of 1s and primes), 121 terms are prime. Eleven of them appear more than once, and so are a(1), ..., a(11).
Among the first 10^100 terms of A132199 there are 18321 primes; of these, 3074 are distinct and 351 repeated. - Giovanni Resta, Apr 08 2016
See the crossrefs for references, links, and additional comments.

Examples

			The first duplicate in Rowland's sequence of primes A137613 = 5, 3, 11, 3, 23, 3, 47, 3, 5, ... is 3, so a(1) = 3. The second duplicate is 5, so a(2) = 5.
		

Crossrefs

Programs

  • Mathematica
    t = {}; b1 = 7; Do[b0 = b1; b1 = b0 + GCD[n, b0]; d = b1 - b0; If[d > 1, AppendTo[t, d]], {n, 2, 10^8}]; L = {}; Do[ If[MemberQ[Take[t, n - 1], t[[n]]], AppendTo[L, t[[n]]]], {n, 2, Length[t]}]; DeleteDuplicates[L]

Extensions

a(12)-a(57) from Giovanni Resta, Apr 08 2016

A231900 Omit the 1s from first differences of A084663.

Original entry on oeis.org

2, 7, 13, 5, 29, 3, 59, 3, 7, 5, 3, 131, 3, 263, 3, 17, 3, 5, 3, 19, 569, 3, 17, 3, 13, 7, 5, 3, 1181, 3, 17, 3, 2381, 3, 11, 3, 5, 3, 7, 4787, 3, 5, 3, 11, 3, 53, 3, 11, 3, 13, 19, 9689, 3, 19379, 3, 7, 5, 3, 137, 3, 13, 38921, 3, 17, 3, 7, 77867, 3, 5, 3
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 15 2013

Keywords

Comments

Terms greater than 1 in A134744.

Crossrefs

Cf. A137613.

Programs

  • Haskell
    a231900 n = a231900_list !! (n-1)
    a231900_list = filter (> 1) a134744_list
  • Mathematica
    DeleteCases[Differences[RecurrenceTable[{a[1]==8,a[n]==a[n-1]+GCD[ a[n-1],n]},a,{n,100000}]],1] (* Harvey P. Dale, Apr 12 2016 *)

A141537 An example of a simple prime-generating algorithm similar to Rowland's (A106108) that is a particular instance of a more general algorithm (see comments).

Original entry on oeis.org

47, 227, 71, 359, 113, 563, 173, 839, 251, 1187, 347, 1607, 461, 2099, 593, 2663, 743, 3299, 911, 4007, 1097, 4787, 1301, 5639, 1523, 6563, 43, 7559, 43, 8627, 2297, 9767, 2591, 10979, 2903, 12263, 53, 13619, 3581, 41, 3947, 16547, 61, 18119, 4733, 19763, 5153, 47
Offset: 1

Views

Author

Aldrich Stevens (aldrichstevens(AT)msn.com), Aug 15 2008

Keywords

Comments

Below is a general algorithm that can be used as a starting point for finding similar ones and three examples.
Not every possibility will work (additional conditions may apply) but it is easy to see that there are an infinite number of algorithms much like Rowland's that will have hundreds or thousands of primes between the 1's before a composite is encountered.
1) Initialize the integers x, k, a and b and choose f(x), g(k).
2) Repeat indefinitely:
2a) x = x + 1;
2b) set c = GCD( f(x), f(x - 1) - a*g(k) );
2c) if c > 1, then c is a term of the sequence and k = k + b.
The present sequence is generated by using f(x) = x^2 - x + 41, g(k) = k, x = 1, k = 2, a = 3 and b = 1.
Examples:
A) f(x) = 5*x^2 + 5*x + 1, g(k) = k, x = 1, k = 2, a = 10, b = 1. These values generate the sequence: 11, 31, 61, 101, 151, 211, 281, 19, 41, 29, 661, 11, 911, 1051, 1201, 1361, 1531, 59, 1901, ...
B) f(x) = x^2 - x + 41, g(k) = k, x = 1, k = 2, a = 3, b = 1. These values generate the sequence: 47, 227, 71, 359, 113, 563, 173, 839, 251,1187,347, 1607, 461,2099,593, 2663, 743,3299, 911, 4007, ...
C) f(x) = 5*x^2 + 5*x + 1, g(k) = k^2 - k + 41, x = 1, k = 2, a = 2, b = 1. These values generate the sequence: 11, 1979, 2549, 11,4691, 11, 8929, 29, 11, 22051, 41, 19, 48619, 61751, 11, 229, 11, 144779, 175141, 11, ...

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

  • Mathematica
    Module[{k = 2, c, f}, f[x_] := x^2 - x + 41; Table[If[(c = GCD[f[x], f[x - 1] - 3*k]) > 1, k++; c, Nothing], {x, 12000}]] (* Paolo Xausa, Jan 31 2025 *)

Extensions

Edited by Paolo Xausa, Jan 31 2025

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}]]
Showing 1-10 of 10 results.