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

A047241 Numbers that are congruent to {1, 3} mod 6.

Original entry on oeis.org

1, 3, 7, 9, 13, 15, 19, 21, 25, 27, 31, 33, 37, 39, 43, 45, 49, 51, 55, 57, 61, 63, 67, 69, 73, 75, 79, 81, 85, 87, 91, 93, 97, 99, 103, 105, 109, 111, 115, 117, 121, 123, 127, 129, 133, 135, 139, 141, 145, 147, 151, 153, 157, 159, 163, 165, 169, 171, 175, 177, 181, 183
Offset: 1

Views

Author

Keywords

Comments

Also the numbers k such that 10^p+k could possibly be prime. - Roderick MacPhee, Nov 20 2011 This statement can be written as follows. If 10^m + k = prime, for any m >= 1, then k is in this sequence. See the pink box comments by Roderick MacPhee from Dec 09 2014. - Wolfdieter Lang, Dec 09 2014
The odd-indexed terms are one more than the arithmetic mean of their neighbors; the even-indexed terms are one less than the arithmetic mean of their neighbors. - Amarnath Murthy, Jul 29 2003
Partial sums are A212959. - Philippe Deléham, Mar 16 2014
12*a(n) is conjectured to be the length of the boundary after n iterations of the hexagon and square expansion shown in the link. The squares and hexagons have side length 1 in some units. The pattern is supposed to become the planar Archimedean net 4.6.12 when n -> infinity. - Kival Ngaokrajang, Nov 30 2014
Positive numbers k for which 1/2 + k/3 + k^2/6 is an integer. - Bruno Berselli, Apr 12 2018

References

  • L. Lovasz, J. Pelikan, K. Vesztergombi, Discrete Mathematics, Springer (2003); 14.4, p. 225.

Crossrefs

Subsequence of A186422.
Union of A016921 and A016945. - Wesley Ivan Hurt, Sep 28 2013

Programs

  • Haskell
    a047241 n = a047241_list !! (n-1)
    a047241_list = 1 : 3 : map (+ 6) a047241_list
    -- Reinhard Zumkeller, Feb 19 2013
    
  • Maple
    seq(3*k-2-((k+1) mod 2), k=1..100); # Wesley Ivan Hurt, Sep 28 2013
  • Mathematica
    Table[{2, 4}, {30}] // Flatten // Prepend[#, 1]& // Accumulate (* Jean-François Alcover, Jun 10 2013 *)
    Select[Range[200], MemberQ[{1, 3}, Mod[#, 6]]&] (* or *) LinearRecurrence[{1, 1, -1}, {1, 3, 7}, 70] (* Harvey P. Dale, Oct 01 2013 *)
  • PARI
    a(n)=bitor(3*n-3,1) \\ Charles R Greathouse IV, Sep 28 2013
    
  • Python
    for n in range(1,10**5):print(3*n-2-((n+1)%2)) # Soumil Mandal, Apr 14 2016

Formula

From Paul Barry, Sep 04 2003: (Start)
O.g.f.: (1 + 2*x + 3*x^2)/((1 + x)*(1 - x)^2) = (1 + 2*x + 3*x^2)/((1 - x)*(1 - x^2)).
E.g.f.: (6*x + 1)*exp(x)/2 + exp(-x)/2;
a(n) = 3*n - 5/2 - (-1)^n/2. (End)
a(n) = 2*floor((n-1)/2) + 2*n - 1. - Gary Detlefs, Mar 18 2010
a(n) = 6*n - a(n-1) - 8 with n > 1, a(1)=1. - Vincenzo Librandi, Aug 05 2010
a(n) = 3*n - 2 - ((n+1) mod 2). - Wesley Ivan Hurt, Jun 29 2013
a(1)=1, a(2)=3, a(3)=7; for n>3, a(n) = a(n-1) + a(n-2) - a(n-3). - Harvey P. Dale, Oct 01 2013
From Benedict W. J. Irwin, Apr 13 2016: (Start)
A005408(a(n)+1) = A016813(A001651(n)),
A007310(a(n)) = A005408(A087444(n)-1),
A007310(A005408(a(n)+1)) = A017533(A001651(n)). (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/(4*sqrt(3)) + log(3)/4. - Amiram Eldar, Dec 11 2021

Extensions

Formula corrected by Bruno Berselli, Jun 24 2010

A047273 Numbers that are congruent to {0, 1, 3, 5} mod 6.

Original entry on oeis.org

0, 1, 3, 5, 6, 7, 9, 11, 12, 13, 15, 17, 18, 19, 21, 23, 24, 25, 27, 29, 30, 31, 33, 35, 36, 37, 39, 41, 42, 43, 45, 47, 48, 49, 51, 53, 54, 55, 57, 59, 60, 61, 63, 65, 66, 67, 69, 71, 72, 73, 75, 77, 78, 79, 81, 83, 84, 85, 87, 89, 90, 91, 93, 95, 96, 97, 99, 101, 102, 103
Offset: 1

Views

Author

Keywords

Comments

Complement of A047235. - Reinhard Zumkeller, Oct 01 2008

Crossrefs

First differences of A281026.
See A301729 for an essentially identical sequence.

Programs

  • Haskell
    a047273 n = a047273_list !! (n-1)
    a047273_list = 0 : 1 : 3 : 5 : map (+ 6) a047273_list
    -- Reinhard Zumkeller, Feb 19 2013
    
  • Magma
    [(6*n-6+(-1)^(n div 2)+(-1)^(-n div 2))/4: n in [1..100]]; // Wesley Ivan Hurt, May 20 2016
  • Maple
    seq(2*(n-floor(n/4)) - (3-I^n-(-I)^n-(-1)^n)/4, n = 0..69); # Gary Detlefs, Mar 19 2010
  • Mathematica
    LinearRecurrence[{2,-2,2,-1},{0,1,3,5},80] (* Harvey P. Dale, Jan 04 2015 *)
  • PARI
    a(n)=n+(n+1)\4+(n+2)\4
    
  • Sage
    [(lucas_number1(n+2, 0, 1)+3*n)/2 for n in range(0, 70)] # Zerinvary Lajos, Mar 09 2009
    

Formula

G.f.: x*(1+x+x^2)/((1-x)^2*(1+x^2)) = x*(1-x^2)*(1-x^3)/((1-x)^3*(1-x^4)).
a(n) = n + A004524(n+1) = -a(-n) for all n in Z.
Starting (1, 3, 5, ...) = partial sums of (1, 2, 2, 1, 1, 2, 2, 1, 1, ...). - Gary W. Adamson, Jun 19 2008
A093719(a(n)) = 1. - Reinhard Zumkeller, Oct 01 2008
a(n) = 2*(n-floor(n/4)) - (3-I^n-(-I)^n-(-1)^n)/4, with offset 0..a(0)=0. - Gary Detlefs, Mar 19 2010
a(n) = (3*n-3+cos(Pi*n/2))/2. - R. J. Mathar, Oct 08 2010
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-6+(-1)^(n/2)+(-1)^(-n/2))/4. (End)
Euler transform of length 4 sequence [3, -1, -1, 1]. - Michael Somos, Jun 24 2017
Sum_{n>=2} (-1)^n/a(n) = log(2)/3 + log(3)/2. - Amiram Eldar, Dec 16 2021
E.g.f.: (2 + 3*exp(x)*(x - 1) + cos(x))/2. - Stefano Spezia, Jul 26 2024

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

A047261 Numbers that are congruent to {2, 4, 5} mod 6.

Original entry on oeis.org

2, 4, 5, 8, 10, 11, 14, 16, 17, 20, 22, 23, 26, 28, 29, 32, 34, 35, 38, 40, 41, 44, 46, 47, 50, 52, 53, 56, 58, 59, 62, 64, 65, 68, 70, 71, 74, 76, 77, 80, 82, 83, 86, 88, 89, 92, 94, 95, 98, 100, 101, 104, 106, 107, 110, 112, 113, 116, 118, 119, 122, 124
Offset: 1

Views

Author

Keywords

Comments

If B and C are terms in the sequence then 2*B*C is a term. B (resp. C) is a term iff B (resp. C) mod 6 = 2, 4 or 5. It follows that (2*B*C) mod 6 = (2*(B mod 6)*(C mod 6)) mod 6 = 2 or 4 and therefore 2*B*C is a term. Examples: for B=16 and C=29, 2*16*29 = 928 is a term: (2*B*C) mod 6 = (2*16*29) mod 6 = 4; (2*2*2) mod 6 = 2. - Jerzy R Borysowicz, May 24 2018

Crossrefs

Cf. A047242 (complement).

Programs

  • Haskell
    a047261 n = a047261_list !! n
    a047261_list = 2 : 4 : 5 : map (+ 6) a047261_list
    -- Reinhard Zumkeller, Feb 19 2013, Jul 06 2012
    
  • Magma
    [n : n in [0..150] | n mod 6 in [2, 4, 5]]; // Wesley Ivan Hurt, Jun 14 2016
  • Maple
    A047261:=n->(6*n-1-2*cos(2*n*Pi/3))/3: seq(A047261(n), n=1..100); # Wesley Ivan Hurt, Jun 14 2016
  • Mathematica
    CoefficientList[Series[(1 + x)*(x^2 + 2)/((1 + x + x^2)*(x - 1)^2), {x, 0, 50}], x] (* Wesley Ivan Hurt, Aug 16 2014 *)
    Select[ Range@ 125, MemberQ[{2, 4, 5}, Mod[#, 6]] &] (* or *)
    LinearRecurrence[{1, 0, 1, -1}, {2, 4, 5, 8}, 62] (* Robert G. Wilson v, Jun 13 2018 *)

Formula

G.f.: x*(1+x)*(x^2+2) / ((1+x+x^2)*(x-1)^2). - R. J. Mathar, Oct 08 2011
A214090(a(n)) = 1. - Reinhard Zumkeller, Jul 06 2012
From Wesley Ivan Hurt, Jun 14 2016: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = (6*n - 1 - 2*cos(2*n*Pi/3))/3.
a(3k) = 6k-1, a(3k-1) = 6k-2, a(3k-2) = 6k-4. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/6 - log(2+sqrt(3))/(2*sqrt(3)) + log(2)/3. - Amiram Eldar, Dec 16 2021
E.g.f.: (3 + exp(x)*(6*x - 1) - 2*exp(-x/2)*cos(sqrt(3)*x/2))/3. - Stefano Spezia, Jul 26 2024

Extensions

More terms from Wesley Ivan Hurt, Aug 16 2014

A083039 Number of divisors of n that are <= 3.

Original entry on oeis.org

1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3
Offset: 1

Views

Author

Daniele A. Gewurz (gewurz(AT)mat.uniroma1.it) and Francesca Merola (merola(AT)mat.uniroma1.it), May 06 2003

Keywords

Comments

Periodic of period 6. Parker vector of the wreath product of S_3 and S, the symmetric group of a countable set.

Examples

			The divisors of 6 are 1, 2, 3 and 6. Of those divisors, 1, 2 and 3 are <= 3. That's three divisors, therefore, a(6) = 3. - _David A. Corneth_, Sep 30 2017
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{-1, 0, 1, 1},{1, 2, 2, 2},90] (* Ray Chandler, Aug 26 2015 *)
  • PARI
    a(n)=[3,1,2,2,2,1][n%6+1];

Formula

G.f.: x/(1-x) + x^2/(1-x^2) + x^3/(1-x^3).
a(n) = a(n-6) = a(-n).
a(n) = 11/6 - (1/2)*(-1)^n - (1/3)*cos(2*Pi*n/3) - (1/3)*3^(1/2)*sin(2*Pi*n/3). - Richard Choulet, Dec 12 2008
a(n) = Sum_{k=1..1} cos(n*(k - 1)/1*2*Pi)/1 + Sum_{k=1..2} cos(n*(k - 1)/2*2*Pi)/2 + Sum_{k=1..3} cos(n*(k - 1)/3*2*Pi)/3. - Mats Granvik, Sep 09 2012
a(n) = log_2(gcd(n,2) + gcd(n,6)). - Gary Detlefs, Feb 15 2014
a(n) = Sum_{d|n, d<=3} 1. - Wesley Ivan Hurt, Oct 30 2023

A097451 Number of partitions of n into parts congruent to {2, 3, 4} mod 6.

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 3, 2, 5, 4, 7, 6, 11, 9, 15, 14, 22, 20, 31, 29, 43, 41, 58, 57, 80, 78, 106, 107, 142, 143, 188, 191, 247, 253, 321, 332, 418, 432, 537, 561, 690, 721, 880, 924, 1118, 1178, 1412, 1493, 1781, 1884, 2231, 2370, 2789, 2965, 3472, 3698, 4309, 4596
Offset: 0

Views

Author

Vladeta Jovovic, Aug 23 2004

Keywords

Comments

Number of partitions of n in which no part is 1, no part appears more than twice and no two parts differ by 1. Example: a(6)=3 because we have [6],[4,2] and [3,3]. - Emeric Deutsch, Feb 16 2006
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).

Examples

			a(8)=5 because we have [8],[44],[422],[332] and [2222].
G.f. = 1 + x^2 + x^3 + 2*x^4 + x^5 + 3*x^6 + 2*x^7 + 5*x^8 + 4*x^9 + ...
G.f. = q^7 + q^55 + q^79 + 2*q^103 + q^127 + 3*q^151 + 2*q^175 + 5*q^199 + ...
		

References

  • G. E. Andrews, The Theory of Partitions, Addison-Wesley, 1976, Exercise 7.9.

Crossrefs

Programs

  • Haskell
    a097451 n = p a047228_list n where
       p _  0         = 1
       p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Nov 16 2012
    
  • Maple
    g:=1/product((1-x^(2+6*j))*(1-x^(3+6*j))*(1-x^(4+6*j)),j=0..15): gser:=series(g,x=0,75): seq(coeff(gser,x,n),n=0..67); # Emeric Deutsch, Feb 16 2006
  • Mathematica
    a[ n_] := SeriesCoefficient[ 1 / Product[ 1 - Boole[ OddQ[ Quotient[ k + 1, 3]]] x^k, {k, n}], {x, 0, n}]; (* Michael Somos, Sep 24 2013 *)
    a[ n_] := SeriesCoefficient[ QPochhammer[ -x^3, x^3] QPochhammer[ x^6] / QPochhammer[ x^2], {x, 0, n}]; (* Michael Somos, Sep 24 2013 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( 1 / prod(k=1, n, 1 - ( (k+1)\3 % 2) * x^k, 1 + x * O(x^n)), n))}; /* Michael Somos, Sep 24 2013 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^6 + A)^2 / (eta(x^2 + A) * eta(x^3 + A)), n))}; /* Michael Somos, Sep 24 2013 */

Formula

Euler transform of period 6 sequence [ 0, 1, 1, 1, 0, 0, ...].
G.f.: 1/Product_{j>=0} ((1-x^(2+6j))(1-x^(3+6j))(1-x^(4+6j))). - Emeric Deutsch, Feb 16 2006
Expansion of psi(x^3) / f(-x^2) in powers of x where psi(), f() are Ramanujan theta functions. - Michael Somos, Sep 24 2013
Expansion of q^(-7/24) * eta(q^6)^2 / (eta(q^2) * eta(q^3)) in powers of q. - Michael Somos, Sep 24 2013
a(n) ~ exp(Pi*sqrt(n/3)) / (4*3^(3/4)*n^(3/4)). - Vaclav Kotesovec, Aug 30 2015
Expansion of f(-x, -x^5) / f(-x, -x^2) in powers of x where f(, ) is Ramanujan's general theta function. - Michael Somos, Oct 06 2015

Extensions

More terms from Emeric Deutsch, Feb 16 2006

A374445 Lexicographically earliest sequence of distinct positive integers such that any pair of consecutive terms are coprime whereas the squarefree kernel of their product is primorial.

Original entry on oeis.org

1, 2, 3, 4, 9, 8, 15, 14, 45, 16, 27, 10, 21, 20, 63, 40, 81, 32, 75, 28, 135, 56, 165, 98, 225, 64, 105, 22, 315, 44, 525, 88, 735, 128, 243, 50, 147, 80, 189, 100, 231, 130, 693, 160, 441, 110, 273, 220, 567, 200, 729, 70, 33, 140, 99, 280, 297, 350, 363
Offset: 1

Views

Author

David James Sycamore, Jul 08 2024

Keywords

Comments

In other words rad(a(n-2)*a(n-1)) is a term in A002110 whereas a(n-2) and a(n-1) share no common divisor > 1. Every term > a(1) = 1 is divisible by 2 or by 3 but not by both, and all terms other than 1,2,3 are composite.
{a(n); n >= 2} is conjectured to be a permutation of A047228.

Examples

			The sequence starts with a(1) = 1, a(2) = 2 since (1,2) = 1 and 1*2 = A002110(1).
a(3) = 3 since (2,3) = 1 and 2*3 = 6 = A002110(2).
		

Crossrefs

Programs

  • Mathematica
    nn = 540; c[_] := False;
    Array[Set[{a[#], c[#]}, {#, True}] &, 2]; j = a[2]; u = 3;
    f[x_] := f[x] = Or[IntegerQ@ Log2[x], And[EvenQ[x], Union@ Differences@ PrimePi@ FactorInteger[x][[All, 1]] == {1}]];
    Monitor[Do[k = u;
      While[Or[! CoprimeQ[j, k], c[k], ! f[j*k]], k++];
      Set[{a[n], c[k], j}, {k, True, k}];
      If[k == u, While[c[u], u++]], {n, 3, nn}], n];
    Array[a, nn] (* Michael De Vlieger, Jul 16 2024 *)
  • PARI
    \\ See Links section.

Extensions

More terms from Rémy Sigrist, Jul 11 2024

A365117 a(1) = 1. Thereafter a(n) is the least novel multiple m of the smallest prime which does not divide a(n-1) and such that m is coprime to a(n-1).

Original entry on oeis.org

1, 2, 3, 4, 9, 8, 15, 14, 27, 10, 21, 16, 33, 20, 39, 22, 45, 26, 51, 28, 57, 32, 63, 34, 69, 38, 75, 44, 81, 40, 87, 46, 93, 50, 99, 52, 105, 58, 111, 56, 117, 62, 123, 64, 129, 68, 135, 74, 141, 70, 153, 76, 147, 80, 159, 82, 165, 86, 171, 88, 177, 92, 183, 94
Offset: 1

Views

Author

David James Sycamore, Aug 22 2023

Keywords

Comments

The Name is as for A351495, but with an extra constraint: namely that a(n) is prime to a(n-1).
{a(n)}; n > 1 is a permutation of A047228.

Examples

			a(2) = 2 because 2 is the smallest prime which does not divide 1, and 2 is prime to 1.
3(3) = 3 because 3 is the smallest prime which does not divide 2, and 3 is prime to 2.
a(4) = 4 since it is the second multiple of 2, the smallest prime that does not divide 3, and 4 is prime to 3.
a(5) = 9 since it is the least novel multiple of 3, the smallest prime that does not divide 4, and is the least such number prime to 4.
		

Crossrefs

Programs

  • Mathematica
    nn = 12; m[] := 1; a[1] = j = 1; m[1] = 2; c[1] = True; c[] := False; f[x_] := Block[{q}, q = 2; While[! CoprimeQ[q, x], q = NextPrime[q]]; q]; Do[{k = m[#]; While[Or[! CoprimeQ[j, k], c[# k]], k++]; If[k == m[#], While[c[m[#] #], m[#]++]]; Set[{a[n], j, c[k #]}, {k #, k #, True}]} &@ f[j], {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Aug 22 2023 *)
  • PARI
    first(n) = {my(res = vector(n)); sofar = Set([1..4]); for(i = 1, 4, res[i] = i); for(i = 5, n, res[i] = nxt(res[i-1])); res}
    nxt(n) = {my(start, step); if(n % 2 == 0, start = 3; step = 6, start = 2; step = [2,4]); forstep(i = start, oo, step, s = Set(i); if(gcd(i, n) == 1 && #setminus(s, sofar) == 1, sofar = setunion(sofar, s); return(i)))} \\ David A. Corneth, Aug 22 2023

Formula

From Michael De Vlieger, Aug 22 2023: (Start)
a(2n) == +-2 (mod 6).
a(2n+1) == 3 (mod 6), n > 0. (End)

Extensions

More terms from David A. Corneth, Aug 22 2023

A374277 Numbers k divisible by exactly one of the prime factors of 30.

Original entry on oeis.org

2, 3, 4, 5, 8, 9, 14, 16, 21, 22, 25, 26, 27, 28, 32, 33, 34, 35, 38, 39, 44, 46, 51, 52, 55, 56, 57, 58, 62, 63, 64, 65, 68, 69, 74, 76, 81, 82, 85, 86, 87, 88, 92, 93, 94, 95, 98, 99, 104, 106, 111, 112, 115, 116, 117, 118, 122, 123, 124, 125, 128, 129, 134
Offset: 1

Views

Author

Michael De Vlieger, Jul 26 2024

Keywords

Comments

Numbers k congruent to r (mod 30), where r is in {2, 3, 4, 5, 8, 9, 14, 16, 21, 22, 25, 26, 27, 28}, residues r = p^m mod 30 and r = (30 - p^m) mod 30.
The asymptotic density of this sequence is 7/15. - Amiram Eldar, Jul 26 2024

Examples

			8 is in this sequence since it is even and a multiple of neither 3 nor 5.
10 is not in this sequence since 10 = 2*5; both 2 and 5 divide 30.
14 is in this sequence since it is even and a multiple of neither 3 nor 5, etc.
		

Crossrefs

Programs

  • Mathematica
    s = Prime@ Range[3]; k = Times @@ s; r = Union[#, k - #] &@ Flatten@ Map[PowerRange[#, k, #] &, s]; m = Length[r]; Array[k*#1 + r[[1 + #2]] & @@ QuotientRemainder[# - 1, m] &, 60]
  • PARI
    is(k) = isprime(gcd(k, 30)); \\ Amiram Eldar, Jul 26 2024

Formula

Intersection of this sequence and 5-smooth numbers (A051037) is A306044 \ {1}.
Showing 1-9 of 9 results.