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

A047237 Numbers that are congruent to {0, 1, 2, 4} mod 6.

Original entry on oeis.org

0, 1, 2, 4, 6, 7, 8, 10, 12, 13, 14, 16, 18, 19, 20, 22, 24, 25, 26, 28, 30, 31, 32, 34, 36, 37, 38, 40, 42, 43, 44, 46, 48, 49, 50, 52, 54, 55, 56, 58, 60, 61, 62, 64, 66, 67, 68, 70, 72, 73, 74, 76, 78, 79, 80, 82, 84, 85, 86, 88, 90, 91, 92, 94, 96, 97
Offset: 1

Views

Author

Keywords

Comments

The sequence is the interleaving of A047238(n) with A016777(n-1). - Guenther Schrack, Feb 11 2019

Crossrefs

Programs

  • GAP
    Filtered([0..100],n->n mod 6 = 0 or n mod 6 = 1 or n mod 6 = 2 or n mod 6 = 4); # Muniru A Asiru, Feb 19 2019
  • Magma
    [n : n in [0..110] | n mod 6 in [0, 1, 2, 4]]; // G. C. Greubel, Feb 16 2019
    
  • Maple
    A047237:=n->(6*n-8+I^(1-n)-I^(1+n))/4: seq(A047237(n), n=1..100); # Wesley Ivan Hurt, May 21 2016
  • Mathematica
    Table[(6n-8+I^(1-n)-I^(1+n))/4, {n, 80}] (* Wesley Ivan Hurt, May 21 2016 *)
    LinearRecurrence[{2,-2,2,-1},{0,1,2,4},120] (* Harvey P. Dale, Jan 21 2018 *)
  • PARI
    my(x='x+O('x^70)); concat([0], Vec(x^2*(1+2*x^2)/((1+x^2)*(1-x)^2))) \\ G. C. Greubel, Feb 16 2019
    
  • Sage
    a=(x^2*(1+2*x^2)/((1+x^2)*(1-x)^2)).series(x, 72).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Feb 16 2019
    

Formula

Starting (1, 2, 4, 6, ...) = partial sums of (1, 1, 2, 2, 1, 1, 2, 2, ...). - Gary W. Adamson, Jun 19 2008
G.f.: x^2*(1+2*x^2) / ((1+x^2)*(1-x)^2). - R. J. Mathar, Oct 08 2011
From Wesley Ivan Hurt, May 21 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 - 8 + i^(1-n) - i^(1+n))/4 where i=sqrt(-1).
a(2*n) = A016777(n-1), a(2*n-1) = A047238(n). (End)
From Guenther Schrack, Feb 11 2019: (Start)
a(n) = (6*n - 8 + (1 - (-1)^n)*(-1)^(n*(n-1)/2))/4.
a(n) = a(n-4) + 6, a(1)=0, a(2)=1, a(3)=2, a(4)=4, for n > 4.
a(-n) = -A047262(n+2).
a(n) = A118286(n-1)/2 for n > 1.
a(n) = A047255(n) - 1. (End)
Sum_{n>=2} (-1)^n/a(n) = sqrt(3)*Pi/36 + log(2)/3 + log(3)/4. - Amiram Eldar, Dec 16 2021

Extensions

More terms from Wesley Ivan Hurt, May 21 2016

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

A062063 a(n) is the smallest number greater than a(n-1) that is coprime to the last four terms of the sequence, with a(1) = 1, a(2) = 2, a(3) = 3, and a(4) = 5.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 16, 17, 19, 21, 23, 25, 26, 29, 31, 33, 35, 37, 38, 41, 43, 45, 47, 49, 52, 53, 55, 57, 59, 61, 62, 65, 67, 69, 71, 73, 74, 77, 79, 81, 83, 85, 86, 89, 91, 93, 95, 97, 101, 103, 104, 105, 107, 109, 113, 116, 117, 119, 121, 125, 127, 128, 129
Offset: 1

Views

Author

Amarnath Murthy, Jun 12 2001

Keywords

Comments

Is a(n+1) - a(n) bounded?
For n < 10^7, the maximum value of a(n+1) - a(n) is 12. - T. D. Noe, May 14 2007
The first differences appear to be periodic with period 245589; this should lead to a proof that the first differences are bounded. If the pattern holds through a(189103530) then it is proved; it suffices to work mod 2310. - Charles R Greathouse IV, Dec 19 2011

Crossrefs

Programs

  • PARI
    { for (n=1, 1000, if (n>4, until (gcd(a, a1)==1 && gcd(a, a2)==1 && gcd(a, a3)==1 && gcd(a, a4)==1, a++); a4=a3; a3=a2; a2=a1; a1=a, if (n==1, a=a4=1, if (n==2, a=a3=2, if (n==3, a=a2=3, a=a1=5)))); write("b062063.txt", n, " ", a) ) } \\ Harry J. Smith, Jul 31 2009

Extensions

Corrected and extended by Dean Hickerson, Jul 10 2001

A353187 Lexicographically earliest strictly increasing sequence of positive integers in which every triple of consecutive terms contains only one pair that is not coprime.

Original entry on oeis.org

1, 2, 4, 5, 6, 8, 11, 12, 14, 17, 18, 20, 23, 24, 26, 29, 30, 32, 37, 38, 40, 41, 42, 44, 47, 48, 50, 53, 54, 56, 59, 60, 62, 67, 68, 70, 71, 72, 74, 77, 78, 80, 83, 84, 86, 89, 90, 92, 97, 98, 100, 101, 102, 104, 107, 108, 110, 113, 114, 116, 119, 120, 122, 127, 128, 130, 131
Offset: 1

Views

Author

Ivan N. Ianakiev, Apr 29 2022

Keywords

Comments

Based on testing the first 1000 primes of the form 3n-1, it seems that A003627 is a subsequence.

Crossrefs

Cf. A047255.

Programs

  • Mathematica
    next[n_,m_]:=Piecewise[{
    {(k=m+1; While[!CoprimeQ[k,n]||!CoprimeQ[k,m],k++]; k),AllTrue[{n,m},EvenQ]},
    {m+2,OddQ[n]&&EvenQ[m]},{m+1,EvenQ[n]&&OddQ[m]}}];
    a[1]=1;a[2]=2;a[n_]:=a[n]=next[a[n-2],a[n-1]];a/@Range[100]
  • PARI
    { for (v=1, 122, if (v<=2 || ((gcd(pp,p)==1) + (gcd(p,v)==1) + (gcd(v, pp)==1))==2, print1 (v", "); [pp,p]=[p,v])) } \\ Rémy Sigrist, May 01 2022

A282849 Number of divisors k of n such that (n + k^2)/k is a prime.

Original entry on oeis.org

1, 2, 0, 2, 0, 4, 0, 0, 0, 4, 0, 4, 0, 0, 0, 2, 0, 4, 0, 0, 0, 4, 0, 2, 0, 0, 0, 4, 0, 8, 0, 0, 0, 2, 0, 4, 0, 0, 0, 4, 0, 8, 0, 0, 0, 2, 0, 2, 0, 0, 0, 4, 0, 2, 0, 0, 0, 4, 0, 8, 0, 0, 0, 0, 0, 4, 0, 0, 0, 8, 0, 4, 0, 0, 0, 2, 0, 8, 0, 0, 0, 4, 0, 4, 0, 0, 0, 4, 0, 6
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 24 2017

Keywords

Comments

Except for the single case of a(1)=1 all terms are even. - Robert G. Wilson v, Feb 25 2017
First occurrence of 2k: 3, 2, 6, 90, 30, 390, 690, 420, 210, 4290, 3990, 8778, 2310, 3570, 4830, 11550, 38850, 84630, 66990, 79170, 39270, 30030, 51870, 46410, 43890, ..., . - Robert G. Wilson v, Feb 25 2017

Examples

			a(6) = 4 because (6 + 1^2)/1 = 7 is prime, (6 + 2^2)/2 = 5 is prime, (6 + 3^2)/3 = 5 is prime, (6 + 6^2)/6 = 7 is prime, where 1, 2, 3 and 6 are divisors of 6.
		

Crossrefs

Cf. A088627 (number of divisors k of n such that (n + 2*k^2)/k is prime), A047255.

Programs

  • Mathematica
    f[n_] := Block[{d = Divisors@ n}, Length@ Select[d, PrimeQ[(n + #^2)/#] &]]; Array[f, 105] (* Robert G. Wilson v, Feb 25 2017 *)
    Table[DivisorSum[n, 1 &, PrimeQ[(n + #^2)/#] &], {n, 105}] (* Michael De Vlieger, Nov 15 2017 *)
  • PARI
    a(n) = sumdiv(n, k, isprime((n+k^2)/k)); \\ Michel Marcus, Feb 26 2017

Formula

a(1) = 1; for n > 0: a(2n) = 2*A088627(n), a(2n + 1) = 0.

A295075 Numbers k such that d + k/d is never prime for any divisor d of k.

Original entry on oeis.org

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, 64, 65, 67, 68, 69, 71, 73, 74, 75, 77, 79, 80, 81, 83, 85, 86, 87, 89, 91, 92, 93, 94, 95, 97, 98, 99
Offset: 1

Views

Author

Michel Marcus, Nov 13 2017

Keywords

Comments

Numbers k such that A282849(k) = 0.

Crossrefs

Cf. A282849 (number of divisors of n such that d + n/d is prime), A080715 (d + n/d is prime for every divisor d of n).
Includes all elements > 2 of A047255.

Programs

  • Maple
    remove(n -> ormap(t -> isprime(t+n/t), numtheory:-divisors(n)), [$1..100]); # Robert Israel, Nov 14 2017
  • Mathematica
    Select[Range@ 100, Function[k, NoneTrue[Divisors@ k, PrimeQ[# + k/#] &]]] (* Michael De Vlieger, Nov 13 2017 *)
  • PARI
    isok(n) = sumdiv(n, d, isprime(d+n/d)) == 0;

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

A359028 Integers m such that A006218(m+1)/(m+1) > A006218(m)/m.

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, 34, 35, 37, 38, 39, 41, 43, 44, 47, 49, 51, 53, 55, 59, 62, 63, 65, 67, 69, 71, 74, 75, 77, 79, 80, 83, 87, 89, 91, 95, 97, 98, 99, 101, 103, 104, 107, 109, 111, 113, 115, 116, 119, 123, 125, 127, 129
Offset: 1

Views

Author

Bernard Schott, Dec 12 2022

Keywords

Comments

Equivalently: Indices m such that f(m + 1) > f(m) where f(m) = Sum_{k=1..m} d(k) / m, where d(k) is the number of divisors of k (A000005).
This sequence comes from a problem proposed by South Africa during the 47th International Mathematical Olympiad, in 2006 at Ljubljana, Slovenia, but not used for the competition (see link).
In fact, the problem asked for a proof that, for the sequence {f(m)} defined by f(m) = (1/m) * ([m/1] + [m/2] + ... + [m/m]), where [x] denotes the integer part of x,
(a) f(m + 1) > f(m) occurs infinitely often (these are the terms m of this sequence),
(b) f(m + 1) < f(m) occurs infinitely often (see A359029).
Differs from A047255 when a(24) = 34 while A047255(24) = 35.
Some results:
1. For every m, f(m) = (1/m) * ([m/1] + [m/2] + ... + [m/m]) proposed in the problem is the arithmetic mean of d(1), d(2), ..., d(m) = A006218(m)/m.
2. f(m + 1) > f(m) is equivalent to d(m + 1) > f(m).
3. Each m = c - 1, where c is a highly composite number (A002182) is a term.
Proof: in this case, d(m+1) = d(c) > max{d(1), ..., d(m)}; as f(m) = (d(1)+...+d(m)) / m < m*d(c)/m = d(c), it follows that d(m+1) = d(c) > f(m).
4. As there are infinitely many highly composite numbers, that also proves that f(m + 1) > f(m) occurs infinitely often, answer to IMO problem (a).
5. There exist other terms not of the form A002182 - 1: 2, 7, 8, 9, 13, 14, 15, ...
Note that f(m) = f(m+1) is possible iff f(m) = tau(m+1), so f(m) must be an integer (A050226) but this is not sufficient. The only known term such that f(m) = f(m+1) is at m=4, with f(4) = 2 and f(5) = tau(5) = 2.

Examples

			f(7) = (d(1)+d(2)+d(3)+d(4)+d(5)+d(6)+d(7)) / 7 = (1+2+2+3+2+4+2) / 7 = 16/7 < f(6) = (d(1)+d(2)+d(3)+d(4)+d(5)+d(6)) / 6 = (1+2+2+3+2+4) / 6 = 14/6 = 7/3, so 6 is a term.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    for n from 1 to 100 do
    m := (1/(n+1))*sum(tau(k),k=1..n+1) - (1/n)*sum(tau(k),k=1..n);
    if m>0 then print(n); else fi; od:
  • Mathematica
    With[{m = 130}, Position[Differences[Accumulate[DivisorSigma[0, Range[m]]]/Range[m]], ?(# > 0 &)] // Flatten] (* _Amiram Eldar, Dec 12 2022 *)
Showing 1-8 of 8 results.