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 11 results. Next

A027750 Triangle read by rows in which row n lists the divisors of n.

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 2, 4, 1, 5, 1, 2, 3, 6, 1, 7, 1, 2, 4, 8, 1, 3, 9, 1, 2, 5, 10, 1, 11, 1, 2, 3, 4, 6, 12, 1, 13, 1, 2, 7, 14, 1, 3, 5, 15, 1, 2, 4, 8, 16, 1, 17, 1, 2, 3, 6, 9, 18, 1, 19, 1, 2, 4, 5, 10, 20, 1, 3, 7, 21, 1, 2, 11, 22, 1, 23, 1, 2, 3, 4, 6, 8, 12, 24, 1, 5, 25, 1, 2, 13, 26, 1, 3, 9, 27, 1, 2, 4, 7, 14, 28, 1, 29
Offset: 1

Views

Author

Keywords

Comments

Or, in the list of natural numbers (A000027), replace n with its divisors.
This gives the first elements of the ordered pairs (a,b) a >= 1, b >= 1 ordered by their product ab.
Also, row n lists the largest parts of the partitions of n whose parts are not distinct. - Omar E. Pol, Sep 17 2008
Concatenation of n-th row gives A037278(n). - Reinhard Zumkeller, Aug 07 2011
{A210208(n,k): k=1..A073093(n)} subset of {T(n,k): k=1..A000005(n)} for all n. - Reinhard Zumkeller, Mar 18 2012
Row sums give A000203. Right border gives A000027. - Omar E. Pol, Jul 29 2012
Indices of records are in A006218. - Irina Gerasimova, Feb 27 2013
The number of primes in the n-th row is omega(n) = A001221(n). - Michel Marcus, Oct 21 2015
The row polynomials P(n,x) = Sum_{k=1..A000005(n)} T(n,k)*x^k with composite n which are irreducible over the integers are given in A292226. - Wolfdieter Lang, Nov 09 2017
T(n,k) is also the number of parts in the k-th partition of n into equal parts (see example). - Omar E. Pol, Nov 20 2019
Let there be an infinite number of tiles, each labeled with a positive integer m, initially placed on square m of an infinite 1D board. At step n, the leftmost unblocked tile (i.e., the top tile of the leftmost nonempty stack) moves forward exactly m squares, where m is its label. Tiles that land on the same square form a stack, and only the top tile of any stack may move. This sequence records the label m of the tile that moves at step n. - Ali Sada, May 23 2025
All divisors of a positive integer n form a finite set. Extending divisibility to n = 0 by using the definition (k|n <=> exists m such that m*k = n) makes the set of divisors infinite, suggesting the definition was not intended for zero, as arithmetic functions typically apply to n >= 1. So to preserve a core property when generalizing (cardinality), one can define divisors of n >= 0 as the fixed points of the greatest common divisor on the set [n] = {0, 1, 2, ..., n}. By this definition, the divisors of 0 are {0}, since 0|0 and gcd(0, 0) = 0. This definition is not circular because the gcd can be effectively calculated using the Euclidean algorithm. (Cf. links.) - Peter Luschny, Jun 02 2025

Examples

			Triangle begins:
  1;
  1, 2;
  1, 3;
  1, 2, 4;
  1, 5;
  1, 2, 3, 6;
  1, 7;
  1, 2, 4, 8;
  1, 3, 9;
  1, 2, 5, 10;
  1, 11;
  1, 2, 3, 4, 6, 12;
  ...
For n = 6 the partitions of 6 into equal parts are [6], [3,3], [2,2,2], [1,1,1,1,1,1], so the number of parts are [1, 2, 3, 6] respectively, the same as the divisors of 6. - _Omar E. Pol_, Nov 20 2019
		

Crossrefs

Cf. A000005 (row length), A001221, A027749, A027751, A056534, A056538, A127093, A135010, A161700, A163280, A240698 (partial sums of rows), A240694 (partial products of rows), A247795 (parities), A292226, A244051.

Programs

  • Haskell
    a027750 n k = a027750_row n !! (k-1)
    a027750_row n = filter ((== 0) . (mod n)) [1..n]
    a027750_tabf = map a027750_row [1..]
    -- Reinhard Zumkeller, Jan 15 2011, Oct 21 2010
    
  • Magma
    [Divisors(n) : n in [1..20]];
    
  • Maple
    seq(op(numtheory:-divisors(a)), a = 1 .. 20) # Matt C. Anderson, May 15 2017
  • Mathematica
    Flatten[ Table[ Flatten [ Divisors[ n ] ], {n, 1, 30} ] ]
  • PARI
    v=List();for(n=1,20,fordiv(n,d,listput(v,d)));Vec(v) \\ Charles R Greathouse IV, Apr 28 2011
    
  • Python
    from sympy import divisors
    for n in range(1, 16):
        print(divisors(n)) # Indranil Ghosh, Mar 30 2017

Formula

a(A006218(n-1) + k) = k-divisor of n, 1 <= k <= A000005(n). - Reinhard Zumkeller, May 10 2006
T(n,k) = n / A056538(n,k) = A056538(n,n-k+1), 1 <= k <= A000005(n). - Reinhard Zumkeller, Sep 28 2014

Extensions

More terms from Scott Lindhurst (ScottL(AT)alumni.princeton.edu)

A032741 a(0) = 0; for n > 0, a(n) = number of proper divisors of n (divisors of n which are less than n).

Original entry on oeis.org

0, 0, 1, 1, 2, 1, 3, 1, 3, 2, 3, 1, 5, 1, 3, 3, 4, 1, 5, 1, 5, 3, 3, 1, 7, 2, 3, 3, 5, 1, 7, 1, 5, 3, 3, 3, 8, 1, 3, 3, 7, 1, 7, 1, 5, 5, 3, 1, 9, 2, 5, 3, 5, 1, 7, 3, 7, 3, 3, 1, 11, 1, 3, 5, 6, 3, 7, 1, 5, 3, 7, 1, 11, 1, 3, 5, 5, 3, 7, 1, 9, 4, 3, 1, 11, 3, 3, 3, 7, 1, 11, 3, 5, 3, 3, 3, 11, 1, 5, 5
Offset: 0

Views

Author

Patrick De Geest, May 15 1998

Keywords

Comments

Number of d < n which divide n.
Call an integer k between 1 and n a "semi-divisor" of n if n leaves a remainder of 1 when divided by k, i.e., n == 1 (mod k). a(n) gives the number of semi-divisors of n+1. - Joseph L. Pe, Sep 11 2002
a(n+1) is also the number of k, 0 <= k <= n-1, such that C(n,k) divides C(n,k+1). - Benoit Cloitre, Oct 17 2002
a(n+1) is also the number of factors of the n-th degree polynomial x^n + x^(n-1) + x^(n-2) + ... + x^2 + x + 1. Example: 1 + x + x^2 + x^3 = (1+x)(1+x^2) implies a(4)=2.
a(n) is also the number of factors of the n-th Fibonacci polynomial. - T. D. Noe, Mar 09 2006
Number of partitions of n into 2 parts with the second dividing the first. - Franklin T. Adams-Watters, Sep 20 2006
Number of partitions of n+1 into exactly one q and at least one q+1. Example: a(12)=5; indeed, we have 13 = 7 + 6 = 5 + 4 + 4 = 4 + 3 + 3 + 3 = 3 + 2 + 2 + 2 + 2 + 2 = 2 + 11*1.
Differences of A002541. - George Beck, Feb 12 2012
For n > 1: number of ones in row n+1 of triangle A051778. - Reinhard Zumkeller, Dec 03 2014
For n > 0, a(n) is the number of strong divisors of n. - Omar E. Pol, May 03 2015
a(n) is also the number of factors of the (n-1)-th degree polynomial ((x+1)^n-1)/x. Example: for n=6, ((x+1)^6-1)/x = x^5 + 6*x^4 + 15*x^3 + 20*x^2 + 15*x + 6 = (2+x)(1+x+x^2)(3+3x+x^2) implies a(6)=3. - Federico Provvedi, Oct 09 2018
Consider the polynomial P(n,z) = Sum_{i=1..q} d(i)*z^(i-1) where d(1), d(2), ..., d(q) are are the q ordered divisors of n. The sequence lists the numbers of zeros of P(n,z) strictly inside the unit circle. - Michel Lagneau, Apr 06 2025

Examples

			a(6) = 3 since the proper divisors of 6 are 1, 2, 3.
		

References

  • AndrĂ© Weil, Number Theory, An approach through history, From Hammurapi to Legendre, Birkhäuser, 1984, page 5.

Crossrefs

Column 2 of A122934.
Cf. A003238, A001065, A027749, A027751 (list of proper divisors).

Programs

  • GAP
    Concatenation([0],List([1..100],n->Tau(n)-1)); # Muniru A Asiru, Oct 09 2018
    
  • Haskell
    a032741 n = if n == 0 then 0 else a000005 n - 1
    -- Reinhard Zumkeller, Jul 31 2014
    
  • Maple
    A032741 := proc(n)
        if n = 0 then
            0 ;
        else
            numtheory[tau](n)-1 ;
        end if;
    end proc: # R. J. Mathar, Feb 03 2013
  • Mathematica
    Prepend[DivisorSigma[0, Range[99]]-1, 0] (* Jayanta Basu, May 25 2013 *)
  • PARI
    a(n) = if(n<1,0,numdiv(n)-1)
    
  • PARI
    {a(n)=polcoeff(2*sum(m=1,n\2+1,sumdiv(m,d,log(1-x^(m/d) +x*O(x^n) )^(2*d)/(2*d)!)), n)} \\ Paul D. Hanna, Aug 21 2014
    
  • Python
    from sympy import divisor_count
    def A032741(n): return divisor_count(n)-1 if n else 0 # Chai Wah Wu, Mar 14 2023

Formula

a(n) = tau(n)-1 = A000005(n)-1. Cf. A039653.
G.f.: Sum_{n>=1} x^(2*n)/(1-x^n). - Michael Somos, Apr 29 2003
G.f.: Sum_{i>=1} (1-x^i+x^(2*i))/(1-x^i). - Jon Perry, Jul 03 2004
a(n) = Sum_{k=1..floor(n/2)} A051731(n-k,k). - Reinhard Zumkeller, Nov 01 2009
G.f.: 2*Sum_{n>=1} Sum_{d|n} log(1 - x^(n/d))^(2*d) / (2*d)!. - Paul D. Hanna, Aug 21 2014
Dirichlet g.f.: zeta(s)*(zeta(s)-1). - Geoffrey Critzer, Dec 06 2014
a(n) = Sum_{k=1..n-1} binomial((n-1) mod k, k-1). - Wesley Ivan Hurt, Sep 26 2016
a(n) = Sum_{i=1..n-1} floor(n/i)-floor((n-1)/i). - Wesley Ivan Hurt, Nov 15 2017
a(n) = Sum_{i=1..n-1} 1-sign(i mod (n-i)). - Wesley Ivan Hurt, Sep 27 2018
Sum_{k=1..n} a(k) ~ n*log(n) + 2*(gamma - 1)*n, where gamma is Euler's constant (A001620). - Amiram Eldar, Nov 27 2022

Extensions

Typos in definition corrected by Omar E. Pol, Dec 13 2008

A002541 a(n) = Sum_{k=1..n-1} floor((n-k)/k).

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 9, 12, 14, 17, 18, 23, 24, 27, 30, 34, 35, 40, 41, 46, 49, 52, 53, 60, 62, 65, 68, 73, 74, 81, 82, 87, 90, 93, 96, 104, 105, 108, 111, 118, 119, 126, 127, 132, 137, 140, 141, 150, 152, 157, 160, 165, 166, 173, 176, 183, 186, 189, 190, 201, 202, 205
Offset: 1

Views

Author

Keywords

Comments

Number of pairs (a, b) with 1 <= a < b <= n, a | b.
The sequence shows how many digit "skips" there have been from 2 to n, a skip being either a prime factor or product thereof. Every time you have a place where you have X skips and the next skip value is X+1, you will have a prime number since a prime number will only add exactly one more skip to get to it. a(n) = Sum_{x=2..n} floor(n/x) - Sum_{x=2..n-1} floor( (n-1)/x) = 1 when prime. - Marius-Paul Dumitrean (marius(AT)neldor.com), Feb 19 2007
A027749(a(n)+1) = n; A027749(a(n)+2) = A020639(n+1). - Reinhard Zumkeller, Nov 22 2003
Number of partitions of n into exactly 2 types of part, where one part is 1, e.g., n=7 gives 1111111, 111112, 11122, 1222, 11113, 133, 1114, 115 and 16, so a(7)=9. - Jon Perry, May 26 2004
The sequence of partial sums of A032741. Idea of proof: floor((n-k)/k) - floor((n-k-1)/k) only increases by 1 when k | n. - George Beck, Feb 12 2012
Also the number of integer partitions of n whose non-1 parts are all equal and with at least one non-1 part. - Gus Wiseman, Oct 07 2018

Examples

			From _Gus Wiseman_, Oct 07 2018: (Start)
The integer partitions whose non-1 parts are all equal and with at least one non-1 part:
  (2)  (3)   (4)    (5)     (6)      (7)       (8)        (9)
       (21)  (22)   (41)    (33)     (61)      (44)       (81)
             (31)   (221)   (51)     (331)     (71)       (333)
             (211)  (311)   (222)    (511)     (611)      (441)
                    (2111)  (411)    (2221)    (2222)     (711)
                            (2211)   (4111)    (3311)     (6111)
                            (3111)   (22111)   (5111)     (22221)
                            (21111)  (31111)   (22211)    (33111)
                                     (211111)  (41111)    (51111)
                                               (221111)   (222111)
                                               (311111)   (411111)
                                               (2111111)  (2211111)
                                                          (3111111)
                                                          (21111111)
(End)
		

References

  • J. P. Gram, Undersoegelser angaaende maengden af primtal under en given graense, Det Kongelige Danskevidenskabernes Selskabs Skrifter, series 6, vol. 2 (1884), 183-288; see Tab. VII: Vaerdier af Funktionen psi(n) og andre numeriske Funktioner, pp. 281-288, especially p. 281.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Antidiagonal sums of array A003988. Antidiagonal sums of A004199.

Programs

  • Haskell
    a002541 n = sum $ zipWith div [n - 1, n - 2 ..] [1 .. n - 1]
    -- Reinhard Zumkeller, Jul 05 2013
    
  • Maple
    a:= proc(n) option remember; `if`(n<2, 0,
          numtheory[tau](n)-1+a(n-1))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jun 12 2021
  • Mathematica
    Table[Sum[Floor[(n-k)/k],{k,n-1}],{n,100}] (* Harvey P. Dale, May 02 2011 *)
  • PARI
    a(n)=sum(k=1,n-1, n\k-1) \\ Charles R Greathouse IV, Feb 07 2017
    
  • PARI
    first(n)=my(v=vector(n),s); for(k=1,n, v[k]=-k+s+=numdiv(k)); v \\ Charles R Greathouse IV, Feb 07 2017
    
  • Python
    from math import isqrt
    def A002541(n): return (sum(n//k for k in range(1,isqrt(n)+1))<<1)-isqrt(n)**2-n # Chai Wah Wu, Oct 20 2023

Formula

a(n) = -n + Sum_{k=1..n} tau(k). - Vladeta Jovovic, Oct 17 2002
G.f.: 1/(1-x) * Sum_{k>=2} x^k/(1-x^k). - Benoit Cloitre, Apr 23 2003
a(n) = Sum_{i=2..n} floor(n/i). - Jon Perry, Feb 02 2004
a(n) = (Sum_{i=2..n} ceiling((n+1)/i)) - n + 1. - Jon Perry, May 26 2004 [corrected by Jason Yuen, Jul 31 2024]
a(n) = A006218(n) - n. Proof: floor((n-k)/k)+1 = floor(n/k). Then Sum_{k=1..n-1} floor((n-k)/k)+(n-1)+1 = Sum_{k=1..n-1} floor(n/k) + floor(n/n) = Sum_{k=1..n} floor(n/k); i.e., a(n) + n = A006218(n). - Philippe LALLOUET (philip.lallouet(AT)wanadoo.fr), Jun 23 2007
a(n) = A161886(n) - (2n-1). - Eric Desbiaux, Jul 10 2013
a(n+1) = Sum_{k=1..n} A004199(n-k+1,k). - L. Edson Jeffery, Aug 31 2014
a(n) = -Sum_{i=1..n} floor((n-2i+1)/(n-i+1)). - Wesley Ivan Hurt, May 08 2016
a(n) = Sum_{i=1..floor(n/2)} floor((n-i)/i). - Wesley Ivan Hurt, Nov 16 2017
a(n) = Sum_{k=1..n-1} (A000005(n-k) - 1). - Gus Wiseman, Oct 07 2018
a(n) ~ n * (log(n) + 2*EulerGamma - 2). - Rok Cestnik, Dec 19 2020

Extensions

More terms from David W. Wilson

A328195 Maximum length of a divisibility chain of consecutive divisors of n greater than 1.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 2, 1, 2, 2, 4, 1, 2, 1, 3, 2, 2, 1, 2, 2, 2, 3, 3, 1, 2, 1, 5, 2, 2, 2, 2, 1, 2, 2, 3, 1, 2, 1, 3, 2, 2, 1, 2, 2, 2, 2, 3, 1, 2, 2, 3, 2, 2, 1, 2, 1, 2, 2, 6, 2, 2, 1, 3, 2, 2, 1, 2, 1, 2, 2, 3, 2, 2, 1, 3, 4, 2, 1, 2, 2, 2, 2, 4, 1, 2, 2, 3, 2, 2, 2, 2, 1, 2, 3, 3, 1, 2, 1, 4, 2
Offset: 1

Views

Author

Gus Wiseman, Oct 14 2019

Keywords

Comments

Also the maximum length of a divisibility chain of consecutive divisors of n less than n.
The divisors of n (except 1) are row n of A027749.

Examples

			The divisors of 272 greater than 1 are {2, 4, 8, 16, 17, 34, 68, 136, 272}, with divisibility chains {{2, 4, 8, 16}, {17, 34, 68, 136, 272}}, so a(272) = 5.
		

Crossrefs

Allowing 1 as a divisor gives A328162.
Forbidding n as a divisor of n gives A328194.
Positions of 1's are A000040 (primes).
Indices of terms greater than 1 are A002808 (composite numbers).
The maximum run-length of divisors of n is A055874(n).

Programs

  • Mathematica
    Table[If[n==1,0,Max@@Length/@Split[DeleteCases[Divisors[n],1],Divisible[#2,#1]&]],{n,100}]
  • PARI
    A328195(n) = if(1==n, 0, my(divs=divisors(n), rl=0,ml=1); for(i=2,#divs,if(!(divs[i]%divs[i-1]), rl++, ml = max(rl,ml); rl=1)); max(ml,rl)); \\ Antti Karttunen, Dec 07 2024

Extensions

Data section extended up to a(105) by Antti Karttunen, Dec 07 2024

A377078 Lexicographically earliest infinite sequence of distinct positive integers such that, for n > 2, a(n) shares a factor with a(n-2) mod a(n-1).

Original entry on oeis.org

2, 3, 4, 6, 8, 9, 10, 12, 5, 14, 15, 16, 18, 20, 21, 22, 24, 11, 26, 33, 13, 7, 27, 28, 30, 32, 25, 35, 40, 42, 34, 36, 17, 38, 51, 19, 39, 57, 45, 46, 48, 23, 44, 69, 50, 76, 52, 54, 56, 58, 49, 60, 63, 55, 62, 65, 31, 66, 93, 64, 29, 68, 87, 70, 85, 72, 78, 74, 80, 37, 75, 111, 81, 82, 84, 41, 86, 123, 43, 148, 129, 95, 88, 77, 99, 91, 92, 98, 90, 94
Offset: 1

Views

Author

Scott R. Shannon, Oct 15 2024

Keywords

Comments

To ensure the sequence is infinite a(n) must be chosen so that a(n-1) mod a(n) is not 0 or 1. In the first 100000 terms the fixed points are 119, 205, 287, and it is likely no more exist. It is conjectured all numbers > 1 appear in the sequence.

Examples

			a(4) = 6 as a(2) mod a(3) = 3 mod 4 = 3, and 6 is the earliest unused number that shares a factor with 3.
a(12) = 16 as a(10) mod a(11) = 14 mod 15 = 14, and 16 shares a factor with 14. Note that 7 is unused and shares a factor with 14 but a(11) mod 7 = 1, so choosing a(12) = 7 would mean a(13) would not exist.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 2; a[2] = 3; hs = {a[1], a[2]}; pool = Range[4, 1000];
    a[n_] := a[n] = Module[{m, pos}, pool = Complement[pool, hs];m = Mod[a[n - 2], a[n - 1]]; pos = FirstPosition[pool, _?(Mod[a[n - 1], #] > 1 && GCD[#, m] > 1 &)][[1]]; AppendTo[hs, pool[[pos]]]; pool[[pos]]]
    Array[a, 90, 1] (* Shenghui Yang, Oct 16 2024*)
  • Python
    from math import gcd
    from itertools import count, islice
    def agen(): # generator of terms
        an2, an1, aset, m = 2, 3, {2, 3}, 4
        yield from [2, 3]
        while True:
            t = an2%an1
            an = next(k for k in count(m) if k not in aset and an1%k > 1 and gcd(k, t) > 1)
            yield an
            aset.add(an)
            while m in aset: m += 1
            an2, an1 = an1, an
    print(list(islice(agen(), 90))) # Michael S. Branicky, Oct 15 2024

A359114 a(1) = 1; for n > 1, a(n) is the smallest positive number which has not appeared that shares a factor with the sum of the first n bits of the binary Champernowne string starting from 1.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 10, 15, 8, 9, 7, 12, 18, 21, 14, 11, 16, 13, 26, 39, 52, 20, 22, 24, 25, 28, 30, 17, 34, 27, 32, 19, 35, 33, 36, 38, 40, 23, 42, 44, 45, 46, 48, 49, 50, 29, 51, 31, 54, 55, 57, 60, 63, 66, 56, 58, 62, 64, 65, 68, 69, 70, 37, 74, 72, 76, 78, 75, 80, 41, 82, 77, 81, 84, 43, 86
Offset: 1

Views

Author

Scott R. Shannon, Dec 16 2022

Keywords

Comments

For the binary Champernowne string starting from 1 see A030302. In the first 100000 terms the fixed points are 1, 2, 12, 24, 25; it is likely no more exist. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(3) = 4 as the sum of the first 3 bits of the binary Champernowne string is 1 + 1 + 0 = 2, and 4 is the smallest unused number that shares a factor with 2.
a(10) = 9 as the sum of the first 10 bits of the binary Champernowne string is 1 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 = 6, and 9 is the smallest unused number that shares a factor with 6.
		

Crossrefs

Cf. A030302, A030303, A359663 (base-10), A027749.

A359663 a(1) = 1; for n > 1, a(n) is the smallest positive number which has not appeared that shares a factor with the sum of the first n terms of the Champernowne string starting from 1.

Original entry on oeis.org

1, 3, 2, 4, 5, 6, 7, 8, 9, 10, 12, 47, 14, 21, 15, 13, 11, 16, 18, 61, 20, 67, 73, 22, 24, 26, 25, 28, 30, 17, 27, 32, 33, 107, 109, 36, 19, 29, 34, 38, 127, 39, 35, 137, 40, 42, 44, 45, 48, 46, 49, 51, 43, 50, 54, 52, 57, 31, 55, 193, 56, 60, 23, 58, 62, 64, 63, 66, 65, 68, 70, 72, 69, 77, 75, 37
Offset: 1

Views

Author

Scott R. Shannon, Jan 10 2023

Keywords

Comments

For the Champernowne string starting from 1 see A033307. In the first 100000 terms there are 45 fixed points: 1, 4, 5, 6, 7, ..., 252, 264, 319. It is plausible no more exist. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(3) = 2 as the sum of the first 3 terms of the Champernowne string is 1 + 2 + 3 = 6, and 2 is the smallest unused number that shares a factor with 6.
a(10) = 10 as the sum of the first 10 terms of the Champernowne string is 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 = 46, and 10 is the smallest unused number that shares a factor with 46.
		

Crossrefs

Cf. A033307, A065648, A359114 (base-2), A027749.

A377182 Lexicographically earliest infinite sequence of distinct positive integers such that, for n > 2, a(n) shares a factor with a(n-2) mod a(n-1) while a(n-1) mod a(n) has not previously occurred as the mod value for any consecutive pair of terms.

Original entry on oeis.org

2, 3, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 26, 27, 28, 30, 32, 25, 35, 40, 42, 44, 33, 55, 36, 38, 39, 34, 45, 46, 48, 50, 51, 52, 54, 56, 57, 58, 60, 62, 63, 64, 66, 68, 69, 70, 72, 49, 92, 98, 100, 102, 65, 74, 75, 76, 78, 80, 81, 82, 84, 86, 87, 88, 90, 77, 91, 99, 104, 105, 106, 108, 110, 93, 119, 120, 126, 85, 123, 125, 96, 116, 117, 118, 129, 130
Offset: 1

Views

Author

Scott R. Shannon, Oct 18 2024

Keywords

Comments

To ensure the sequence is infinite a(n) must be chosen so that a(n-1) mod a(n) is not 0 or 1. Care must also be taken when choosing a(n) if it is equal to any previously occurring mod value as one is not then guaranteed the next term will exist - in such cases smaller unused mod values must be checked for a valid next term, otherwise the term must be rejected and the next largest candidate trialled.
Surprisingly the first prime to occur is a(94122) = 47857. The next is a(103105) = 26591, and no other primes appear in the first 500000 terms. It is unknown if more occur or why it takes so many terms for a prime to appear. Many small primes, like 5, can never occur as all mod values less than the prime have already appeared. It is conjectured all missing numbers are prime.
In the first 500000 terms the fixed points are 111, 533, 649, 11957; it is unknown if more exist.
Keyword "look" refers to Scott Shannon's image of 100000 terms. - N. J. A. Sloane, Oct 19 2024

Examples

			a(4) = 6 as a(2) mod a(3) = 3 mod 4 = 3, and 6 is the earliest unused number that shares a factor with 3 while 3 has not occurred as a mod value for any previous pair.
a(9) = 14 as a(7) mod a(8) = 10 mod 12 = 10, and 14 factor with 10. Note that 5 is unused and shares a factor with 10 but a(8) mod 5 = 12 mod 5 = 2, but 2 has previously occurred as the mod value for a(1) mod a(2), so 5 cannot be used. This is the first term to differ from A377078.
		

Crossrefs

Programs

  • Mathematica
    nn = 120;
    c[] := False; m[] := False;
    Array[Set[{a[#], c[# + 1]}, {# + 1, True}] &, 2];
    Set[{i, j, v}, {a[1], a[2], 2}];
    mj = Mod[i, j]; Array[Set[m[#], True] &, mj + 1, 0];
    Do[k = v;
      While[Set[mk, Mod[j, k]]; Or[c[k], m[mk], m[k], CoprimeQ[mj, k]], k++];
      While[m[v], v++];
      Set[{a[n], c[k], m[mk], i, j, mj}, {k, True, True, j, k, mk}], {n, 3, nn}];
    Array[a, nn] (* Michael De Vlieger, Oct 19 2024 *)

A347619 Earliest sequence of integers > 1 such that gcd(a(n),a(n+k)) = 1, where k = 1..a(n-1), with a(1) = 1 and a(2) = 2.

Original entry on oeis.org

1, 2, 3, 2, 5, 3, 7, 2, 5, 11, 7, 3, 5, 13, 17, 2, 5, 11, 19, 3, 5, 13, 7, 11, 5, 23, 29, 13, 17, 31, 19, 11, 23, 2, 37, 41, 5, 7, 37, 3, 43, 47, 17, 7, 23, 43, 37, 31, 53, 59, 29, 11, 23, 61, 67, 71, 73, 2, 13, 79, 83, 7, 13, 19, 23, 89, 97, 101, 103, 43, 13, 107, 109, 41, 79, 113, 127, 3, 5
Offset: 1

Views

Author

Scott R. Shannon, Sep 09 2021

Keywords

Comments

As the sequence always takes the earliest number satisfying the restriction gcd(a(n),a(n+k)) = 1, all the terms beyond a(1) will be prime.

Examples

			a(3) = 3, as a(1) = 1, a(2) = 2, so the next one term after a(2) cannot share a divisor with 2, and the smallest such number is 3.
a(4) = 2 and a(5) = 5, as a(2) = 2, a(3) = 3, so the next two terms after a(3) cannot share a divisor with 3. The first such term is 2. But now a(3) = 3 and a(4) = 2, so the next three terms after a(4) cannot share a divisor with 2. The smallest number which satisfies both of these restrictions is 5.
		

Crossrefs

A356255 a(1) = 1; for n > 1, a(n) is the smallest magnitude number not occurring earlier such that n is divisible by s = Sum_{k = 1..n} a(k), where |s| > 1.

Original entry on oeis.org

1, -3, -1, 5, 3, -2, 4, -5, 7, -4, 6, -7, 9, -6, 8, -11, 13, -8, 10, -9, 11, -10, 12, -15, -13, 18, 14, -20, 22, -14, 16, -23, -19, 28, -12, -17, -25, 35, 15, -18, -36, 20, -22, 21, 17, -41, 93, -31, 33, -24, 26, -38, 40, -26, -16, -39, 25, 32, 30, -29, 31, -30, -28, 29, -27, 61, -133, 50, -52, 34
Offset: 1

Views

Author

Scott R. Shannon, Oct 15 2022

Keywords

Comments

The sequence is finite - after 2020 terms, a(2020) = -669, the sum of all terms is 4 so the next term would have to be 4 less than the divisors with magnitude > 1 of 2021, namely 2017, 43, 39, -47, -51, -2025. However these six numbers have all previously occurred so the sequence terminates.

Examples

			a(7) = 4 as Sum_{k = 1..7} a(k) = 1 - 3 - 1 + 5 + 3 - 2 + 4 = 7, and 4 is the smallest magnitude number not occurring earlier that forms a sum with magnitude > 1 that is a divisor of 7.
		

Crossrefs

Cf. A019444 (sum of terms is divisible by n), A027749, A027750.
Showing 1-10 of 11 results. Next