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

A047255 Numbers that are congruent to {1, 2, 3, 5} mod 6.

Original entry on oeis.org

1, 2, 3, 5, 7, 8, 9, 11, 13, 14, 15, 17, 19, 20, 21, 23, 25, 26, 27, 29, 31, 32, 33, 35, 37, 38, 39, 41, 43, 44, 45, 47, 49, 50, 51, 53, 55, 56, 57, 59, 61, 62, 63, 65, 67, 68, 69, 71, 73, 74, 75, 77, 79, 80, 81, 83, 85, 86, 87, 89, 91, 92, 93, 95, 97, 98, 99, 101, 103, 104
Offset: 1

Views

Author

Keywords

Comments

Each element is coprime to preceding two elements. - Amarnath Murthy, Jun 12 2001
The sequence is the interleaving of A047241 with A016789. - Guenther Schrack, Feb 16 2019

Examples

			After 21 and 23 the next term is 25 as 24 has a common divisor with 21.
		

Crossrefs

Programs

  • Haskell
    a047255 n = a047255_list !! (n-1)
    a047255_list = 1 : 2 : 3 : 5 : map (+ 6) a047255_list
    -- Reinhard Zumkeller, Jan 17 2014
    
  • Magma
    [n : n in [0..100] | n mod 6 in [1, 2, 3, 5]]; // Wesley Ivan Hurt, May 21 2016
    
  • Maple
    A047255:=n->(6*n-4+I^(1-n)+I^(n-1))/4: seq(A047255(n), n=1..100); # Wesley Ivan Hurt, May 20 2016
  • Mathematica
    Select[Range[100], MemberQ[{1, 2, 3, 5}, Mod[#, 6]] &]
    LinearRecurrence[{2,-2,2,-1},{1,2,3,5},100] (* Harvey P. Dale, May 14 2020 *)
  • PARI
    a(n)=([0,1,0,0; 0,0,1,0; 0,0,0,1; -1,2,-2,2]^(n-1)*[1;2;3;5])[1,1] \\ Charles R Greathouse IV, Feb 11 2017
    
  • Sage
    a=(x*(1+x^2+x^3)/((1+x^2)*(1-x)^2)).series(x, 80).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Feb 16 2019

Formula

{k | k == 1, 2, 3, 5 (mod 6)}.
G.f.: x*(1 + x^2 + x^3) / ((1+x^2)*(1-x)^2). - R. J. Mathar, Oct 08 2011
From Wesley Ivan Hurt, May 20 2016: (Start)
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4), for n>4.
a(n) = (6*n - 4 + i^(1-n) + i^(n-1))/4, where i = sqrt(-1).
a(2*n) = A016789(n-1) for n>0, a(2*n-1) = A047241(n). (End)
E.g.f.: (2 + sin(x) + (3*x - 2)*exp(x))/2. - Ilya Gutkovskiy, May 21 2016
a(1-n) = - A047251(n). - Wesley Ivan Hurt, May 21 2016
From Guenther Schrack, Feb 16 2019: (Start)
a(n) = (6*n - 4 + (1 - (-1)^n)*(-1)^(n*(n-1)/2))/4.
a(n) = a(n-4) + 6, a(1)=1, a(2)=2, a(3)=3, a(4)=5, for n > 4.
a(n) = A047237(n) + 1. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = 5*sqrt(3)*Pi/36 + log(2)/3 - log(3)/4. - Amiram Eldar, Dec 17 2021
a(n) = 2*n - 1 - floor(n/2) + floor(n/4) - floor((n+1)/4). - Ridouane Oudra, Feb 21 2023

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jun 15 2001

A062062 Smallest increasing sequence where each term is coprime to preceding three terms.

Original entry on oeis.org

1, 2, 3, 5, 7, 8, 9, 11, 13, 14, 15, 17, 19, 22, 23, 25, 27, 28, 29, 31, 33, 34, 35, 37, 39, 41, 43, 44, 45, 47, 49, 52, 53, 55, 57, 58, 59, 61, 63, 64, 65, 67, 69, 71, 73, 74, 75, 77, 79, 82, 83, 85, 87, 88, 89, 91, 93, 94, 95, 97, 99, 101, 103, 104, 105, 107, 109, 113
Offset: 1

Views

Author

Amarnath Murthy, Jun 12 2001

Keywords

Comments

a(n+125) = a(n) + 210, n >= 7. Also maximal term difference is 4 = a(68)-a(67). - David W. Wilson, Jun 18 2001

Examples

			After 19, 22, 23 the next term is 25 as 24 has 2 as common divisor with 22.
		

Crossrefs

Programs

  • Mathematica
    a[ 1 ]=1; a[ 2 ]=2; a[ 3 ]=3; a[ n_ ] := a[ n ]=Module[ {}, b=a[ n-1 ]; While[ GCD[ b, a[ n-1 ] ]>1||GCD[ b, a[ n-2 ] ]> 1||GCD[ b, a[ n-3 ] ]>1, b++ ]; b ] Array[ a, 100 ]
  • PARI
    { for (n=1, 1000, if (n>3, until (gcd(a, a1)==1 && gcd(a, a2)==1 && gcd(a, a3)==1, a++); a3=a2; a2=a1; a1=a, if (n==1, a=a3=1, if (n==2, a=a2=2, a=a1=3))); write("b062062.txt", n, " ", a) ) } \\ Harry J. Smith, Jul 31 2009

Extensions

More terms from Erich Friedman, Jun 15 2001
Clarified by Charles R Greathouse IV, Aug 02 2010

A328739 Table of A(n,k) read by antidiagonals, where A(n,1)=2, and every n+1 consecutive terms in row n are pairwise coprime. Terms are chosen to be the least increasing value compatible with these constraints.

Original entry on oeis.org

2, 3, 2, 4, 3, 2, 5, 5, 3, 2, 6, 7, 5, 3, 2, 7, 8, 7, 5, 3, 2, 8, 9, 8, 7, 5, 3, 2, 9, 11, 9, 11, 7, 5, 3, 2, 10, 13, 11, 13, 11, 7, 5, 3, 2, 11, 14, 13, 16, 13, 11, 7, 5, 3, 2, 12, 15, 14, 17, 16, 13, 11, 7, 5, 3, 2, 13, 17, 15, 19, 17, 17, 13, 11
Offset: 1

Views

Author

Ali Sada, Oct 26 2019

Keywords

Comments

This algorithm acts as a prime number sieve. Prime numbers move to the left with each step. The second diagonal (and all the numbers to the left) are all primes.
The first composite number in each row: 4, 8, 8, 16, 16, 24, 24, 32, 32, 32, 45, 48, 48, 54, 64, 64, 64, 72, 80, 81, 90, 96, 105, 108, 108, 120, 128, 128, 128, ....
In this sieve, some numbers disappear and then reappear. For example, 26 disappears on the third row, then reappears on the 4th and 5th rows, then disappears again.

Examples

			Table begins:
  2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ...
  2, 3, 5, 7, 8, 9, 11, 13, 14, 15, 17, 19, 20, 21, 23, 25, ...
  2, 3, 5, 7, 8, 9, 11, 13, 14, 15, 17, 19, 22, 23, 25, 27, ...
  2, 3, 5, 7, 11, 13, 16, 17, 19, 21, 23, 25, 26, 29, 31, 33, ...
  2, 3, 5, 7, 11, 13, 16, 17, 19, 21, 23, 25, 26, 29, 31, 33, ...
  2, 3, 5, 7, 11, 13, 17, 19, 23, 24, 25, 29, 31, 37, 41, 43, ...
  2, 3, 5, 7, 11, 13, 17, 19, 23, 24, 25, 29, 31, 37, 41, 43, ...
  2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 32, 35, 37, 39, 41, ...
  2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 32, 37, 41, 43, 45, ...
  2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 32, 37, 41, 43, 45, ...
E.g., in the third row, a(3,1)=2, and every 4 consecutive terms are pairwise coprime.
		

Crossrefs

Programs

  • PARI
    row(N,howmany=100)=my(v=List(primes(N))); for(i=N+1,howmany, my(L=lcm(v[#v-N+1..#v]), n=v[#v]); while(gcd(n,L)>1, n++); listput(v,n)); Vec(v) \\ Charles R Greathouse IV, Oct 27 2019

Formula

A(n, k) = prime(k) if k <= n+1. - M. F. Hasler, May 09 2025
Showing 1-3 of 3 results.