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.

A208768 The distinct values of A070198.

Original entry on oeis.org

0, 1, 5, 11, 59, 419, 839, 2519, 27719, 360359, 720719, 12252239, 232792559, 5354228879, 26771144399, 80313433199, 2329089562799, 72201776446799, 144403552893599, 5342931457063199, 219060189739591199, 9419588158802421599, 442720643463713815199
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 01 2012

Keywords

Comments

The terms of A070198, and duplicates removed.
a(n) = A051451(n) - 1 = A051452(n) - 2.
From Daniel Forgues, Apr 27 2014: (Start)
Factorizations:
5, 11, 59, 419, 839 are primes;
2519 = 11*229, 27719 = 53*523, 360359 = 173*2083,
720719 = 31*67*347, 12252239 = 29*647*653;
232792559, 5354228879 are primes;
26771144399 = 47*12907*44131, 80313433199 = 29*61*45400471;
2329089562799 is prime;
72201776446799 = 37*149*239*1091*50227;
144403552893599 is prime;
Very likely contains an infinite number of primes (see A057824). (End)
A more natural (compare with A051452) name for the sequence: lcm(1, ..., k) - 1, where k is the n-th prime power A000961(n). - Daniel Forgues, May 09 2014

Programs

  • Haskell
    import Data.List (nub)
    a208768 n = a208768_list !! (n-1)
    a208768_list = nub a070198_list
    
  • Python
    from math import prod
    from sympy import primepi, integer_nthroot, integer_log, primerange
    def A208768(n):
        def f(x): return int(n+x-1-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return prod(p**integer_log(m, p)[0] for p in primerange(m+1))-1 # Chai Wah Wu, Aug 15 2024

A091798 Duplicate of A070198.

Original entry on oeis.org

0, 1, 5, 11, 59, 59, 419, 839, 2519, 2519, 27719, 27719, 360359, 360359, 360359
Offset: 1

Views

Author

Keywords

A057820 First differences of sequence of consecutive prime powers (A000961).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 2, 3, 1, 2, 4, 2, 2, 2, 2, 1, 5, 4, 2, 4, 2, 4, 6, 2, 3, 3, 4, 2, 6, 2, 2, 6, 8, 4, 2, 4, 2, 4, 8, 4, 2, 1, 3, 6, 2, 10, 2, 6, 6, 4, 2, 4, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 2, 8, 5, 1, 6, 6, 2, 6, 4, 2, 6, 4, 14, 4, 2, 4, 14, 6, 6, 4, 2, 4, 6, 2, 6, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10
Offset: 1

Views

Author

Labos Elemer, Nov 08 2000

Keywords

Comments

a(n) = 1 iff A000961(n) = A006549(k) for some k. - Reinhard Zumkeller, Aug 25 2002
Also run lengths of distinct terms in A070198. - Reinhard Zumkeller, Mar 01 2012
Does this sequence contain all positive integers? - Gus Wiseman, Oct 09 2024

Examples

			Odd differences arise in pairs in neighborhoods of powers of 2, like {..,2039,2048,2053,..} gives {..,11,5,..}
		

Crossrefs

For perfect-powers (A001597) we have A053289.
For non-perfect-powers (A007916) we have A375706.
Positions of ones are A375734.
Run-compression is A376308.
Run-lengths are A376309.
Sorted positions of first appearances are A376340.
The second (instead of first) differences are A376596, zeros A376597.
Prime-powers:
- terms: A000961 or A246655, complement A024619
- differences: A057820 (this), first appearances A376341
- anti-runs: A373576, A120430, A006549, A373671
Non-prime-powers:
- terms: A361102
- differences: A375708 (ones A375713)
- anti-runs: A373679, A373575, A255346, A373672

Programs

  • Haskell
    a057820_list = zipWith (-) (tail a000961_list) a000961_list
    -- Reinhard Zumkeller, Mar 01 2012
    
  • Maple
    A057820 := proc(n)
            A000961(n+1)-A000961(n) ;
    end proc: # R. J. Mathar, Sep 23 2016
  • Mathematica
    Map[Length, Split[Table[Apply[LCM, Range[n]], {n, 1, 150}]]] (* Geoffrey Critzer, May 29 2015 *)
    Join[{1},Differences[Select[Range[500],PrimePowerQ]]] (* Harvey P. Dale, Apr 21 2022 *)
  • PARI
    isA000961(n) = (omega(n) == 1 || n == 1)
    n_prev=1;for(n=2,500,if(isA000961(n),print(n-n_prev);n_prev=n)) \\ Michael B. Porter, Oct 30 2009
    
  • Python
    from sympy import primepi, integer_nthroot
    def A057820(n):
        def f(x): return int(n+x-1-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        r, k = m, f(m)+1
        while r != k: r, k = k, f(k)+1
        return r-m # Chai Wah Wu, Sep 12 2024

Formula

a(n) = A000961(n+1) - A000961(n).

Extensions

Offset corrected and b-file adjusted by Reinhard Zumkeller, Mar 03 2012

A075059 a(n) = 1 + lcm(1, 2, ..., n) = 1 + A003418(n).

Original entry on oeis.org

2, 2, 3, 7, 13, 61, 61, 421, 841, 2521, 2521, 27721, 27721, 360361, 360361, 360361, 720721, 12252241, 12252241, 232792561, 232792561, 232792561, 232792561, 5354228881, 5354228881, 26771144401, 26771144401, 80313433201, 80313433201
Offset: 0

Views

Author

Amarnath Murthy, Sep 08 2002

Keywords

Comments

Consider the triangle in which the n-th row contains the second run of n consecutive numbers such that the r-th term is divisible by r. Sequence gives the first column of the triangle. The first run trivially begins with 1.
Also the smallest of n consecutive integers (with the first greater than 1) divisible respectively by 1, 2, 3, ..., n. - Robert G. Wilson v, Oct 30 2014
Also the smallest number m > 1 such that m == 1 (mod i) for all 1 <= i <= n. - Franz Vrabec, Aug 18 2023

Examples

			First column of the triangle A075061:
   2;
   3,  4;
   7,  8,  9;
  13, 14, 15, 16;
  61, 62, 63, 64, 65;
  61, 62, 63, 64, 65, 66;
  ...
		

Crossrefs

Programs

Formula

a(n) = 1 + A003418(n).

Extensions

New definition from Vladeta Jovovic, Jun 16 2003
Edited by N. J. A. Sloane, Jul 01 2008 at the suggestion of R. J. Mathar
a(0)=2 prepended by Max Alekseyev, Sep 04 2015

A116151 a(n) = smallest positive integer x satisfying the system of congruences { x == 1 (mod 2), x == 2 (mod 3), x == 3 (mod 5), x == 5 (mod 7), ..., x == A008578(n) (mod A008578(n+1)) }.

Original entry on oeis.org

1, 5, 23, 173, 2273, 2273, 452723, 6578843, 113275433, 3682761353, 10152454583, 5024164707833, 249908523156563, 5726413266646343, 345878207890067123, 15103232990013860963, 1905274424667036455303, 111502614383457156882293
Offset: 1

Views

Author

Christian Bjartli (cbjartli(AT)gmail.com), Apr 14 2007

Keywords

Comments

Minimum Chinese Remainder Prime Modulus Ladder: for the n-th term, the number modulus a prime equals the previous prime for the first n primes (the initial term is defined to be 1). - Fred Schneider, Oct 21 2007

Examples

			a(3)=23 because that is the smallest number such that n==1 (mod 2), n==2 (mod 3) and n == 3 (mod 5).
		

Crossrefs

Cf. A070198.

Programs

  • Maple
    Primes:= [1,seq(ithprime(i),i=1..30)]:
    seq(chrem(Primes[1..k],Primes[2..k+1]),k=1..30); # Robert Israel, Oct 26 2018
  • Mathematica
    Table[ChineseRemainder[Join[{1},Prime[Range[n-1]]],Prime[Range[n]]],{n,20}] (* Harvey P. Dale, Mar 30 2018 *)
  • PARI
    { a(n) = lift(chinese(vector(n,i,Mod(if(i==1,1,prime(i-1)),prime(i))))) }; vector(30,n,a(n)) \\ Max Alekseyev, Apr 16 2007
    
  • PARI
    my(z=Mod(1,2)); forprime(x=3,100,z=chinese(z,Mod(precprime(x-1),x)); print1(lift(z), ", ")); \\ Fred Schneider, Oct 21 2007

Extensions

More terms from Max Alekseyev, Apr 16 2007
Edited by N. J. A. Sloane, May 05 2007
Further edited by N. J. A. Sloane, Jun 30 2008 at the suggestion of R. J. Mathar and Christian Bjartli.

A121934 Smallest positive number m such that m == i (mod i+1) for all 1<=i<=n.

Original entry on oeis.org

1, 1, 5, 11, 59, 59, 419, 839, 2519, 2519, 27719, 27719, 360359, 360359, 360359, 720719, 12252239, 12252239, 232792559, 232792559, 232792559, 232792559, 5354228879, 5354228879, 26771144399, 26771144399, 80313433199, 80313433199
Offset: 1

Views

Author

Zak Seidov, Sep 03 2006

Keywords

Crossrefs

Except for the first term, a duplicate of A070198.

Formula

For n>=2, a(n) = A003418(n+1)-1.

Extensions

Edited by N. J. A. Sloane, Nov 18 2007, at the suggestion of Max Alekseyev.

A187930 Least number r such that r == k-1 (mod prime(k)) for k = 1..n.

Original entry on oeis.org

0, 4, 22, 52, 1522, 29242, 299512, 4383592, 188677702, 5765999452, 5765999452, 2211931390882, 165468170356702, 8075975022064162, 361310530977154972, 20037783573808880092, 1779852341342071295512, 40235059344426324076912, 4966347076439519105374252, 169991099649125127278835142
Offset: 1

Views

Author

Michel Lagneau, Mar 16 2011

Keywords

Examples

			a(4) = 1522 because :
1522 == 0 (mod 2) ;
1522 == 1 (mod 3);
1522 == 2 (mod 5);
1522 == 3 (mod 7);
1522 == 4 (mod 11).
		

Crossrefs

Cf. A070198.

Programs

  • Maple
    with(numtheory):nn:=100:T:=array(1..nn):pr:=1:for k from 1 to nn do: pr:=pr*ithprime(k):T[k]:=pr:od:for  m from 1 to nn do:z:=T[m]:pp:=ithprime(m):id:=0:for x from 0 to z-1 while (id=0)  do:it:=0:for y from 0 to m-1 do:r:=ithprime(y+1):a:=irem(x,r):if a=y then it:=it+1:else
      fi: od:if it =m then id:=1:print(x):else fi:od:od:
  • Mathematica
    Table[ChineseRemainder[Range[n] - 1, Prime[Range[n]]], {n, 20}]

Formula

a(n) = A053664(n) - 1.

A254078 a(n) is the number of steps after which n variables with increasing value ranges all have equal values when the values of all variables are decreased by 1 at each step and the value is set to the maximum value again when the resulting value would be 0.

Original entry on oeis.org

4, 10, 58, 58, 418, 838, 2518, 2518, 27718, 27718, 360358, 360358, 360358, 720718, 12252238, 12252238, 232792558, 232792558, 232792558, 232792558, 5354228878, 5354228878, 26771144398, 26771144398, 80313433198, 80313433198, 2329089562798
Offset: 2

Views

Author

Felix Fröhlich, Jan 25 2015

Keywords

Comments

The k-th variable can take k+1 different values.
From Charlie Neder, Oct 01 2018: (Start)
a(n) is the smallest k congruent to m-2 modulo m for 2 <= m <= n+1.
Proof: All variables will be equal for the first time precisely when they all are equal to 2, in which case each variable has changed from its maximum value m to 2. Additionally, this k is lcm(2,3,...,m) - 2, since advancing two more steps will return all variables to their maximum values.
Adding a variable that only takes one value {1} results in A070198 (LCM - 1). (End)

Examples

			In case of two variables, the first can take two values (1 and 2) and the second three values (1, 2 and 3). Performing the operation on the variables generates sequences of values 2, 1, 2, 1, 2, 1, ... for first variable and 3, 2, 1, 3, 2, 1, ... for second variable. After four steps, the value of both variables is 2, so a(2) = 4.
		

Crossrefs

Cf. A070198 (LCM - 1), A003418 (LCM), A075059 (LCM + 1).

Programs

  • PARI
    a(n) = my(v=vector(n, x, x++), w=v, i=0); while(1, if(vecmax(v)==vecmin(v), return(i)); for(k=1, #v, if(v[k]==1, v[k]=w[k], v[k]--)); i++) \\ Felix Fröhlich, Feb 19 2017
    
  • Python
    from math import gcd
    lcm = 2
    for n in range(3,53):
      lcm *= n // gcd(lcm,n)
      print(n-1,lcm-2) # Charlie Neder, Oct 02 2018

Formula

a(n) = A003418(n+1) - 2. - Charlie Neder, Oct 02 2018

Extensions

Value of a(6) corrected and more terms from Felix Fröhlich, Mar 25 2015
Illustration and program replaced with improved versions by Felix Fröhlich, Feb 19 2017
Corrected and extended by Charlie Neder, Oct 01 2018
Showing 1-8 of 8 results.