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.

User: Elliott Line

Elliott Line's wiki page.

Elliott Line has authored 15 sequences. Here are the ten most recent ones:

A365452 Largest number whose digits, in some base, sum to n and include no zeros.

Original entry on oeis.org

1, 3, 7, 22, 67, 213, 853, 3413, 13653, 66406, 332031, 1660156, 8734003, 52404019, 314424115, 1886544691, 12193514915, 85354604406, 597482230843, 4182375615902, 31414617936457, 251316943491657, 2010535547933257, 16084284383466057, 135502101309790873, 1219518911788117858
Offset: 1

Author

Elliott Line, Sep 04 2023

Keywords

Comments

There is a proviso with this: the first digit must be one less than the base; otherwise we could claim that a number was in an arbitrarily large base.
The maximum value will always be found by following the initial digit with a string of 1s, which is n candidate values for a(n).

Examples

			For n=5, the candidate digits are 11111_2, 2111_3, 311_4, 41_5 and 5_6. These have decimal values 31, 67, 53, 21 and 5, respectively and the largest of is 67, so a(5)=67.
		

Crossrefs

Cf. A000225.

Programs

  • Maple
    a:= n-> max((i+1)^(n-i)*(1/i+i)-1/i$i=1..n):
    seq(a(n), n=1..25);  # Alois P. Heinz, Sep 06 2023
  • PARI
    a(n) = {my(res=2^n-1, v = vector(n, i, 1)); for(i = 2, n, v[i] += v[i-1]; v[i-1] = 0; res = max(res, fromdigits(v, i+1))); res} \\ David A. Corneth, Sep 04 2023
    
  • Python
    def A365452(n): return max(((i + 1)**(n-i)*(i**2 + 1) - 1)//i for i in range(1,n+1)) # Chai Wah Wu, Oct 01 2023

Formula

a(n) >= A000225(n). - David A. Corneth, Sep 04 2023
a(n) = max_{i=1..n} ((i+1)^(n-i)*(1/i+i)-1/i). - Alois P. Heinz, Sep 09 2023

Extensions

More terms from David A. Corneth, Sep 04 2023

A338804 A sequence containing each nonnegative integer exactly twice, such that for all k, k numbers appear in the sequence between the first and second appearances of k.

Original entry on oeis.org

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

Author

Elliott Line, Nov 10 2020

Keywords

Comments

The sequence is constructed so that after the initial two 0's the next three pairs form a self-contained block beginning with 3, the subsequent nine pairs form a self-contained block beginning with 9, the following twenty-seven pairs form a block beginning with 27, etc. (powers of 3: A000244).
There are numerous sequences that satisfy the given criteria, so to fully define the continuation of this sequence I will add the following extra constraints. After the 0th block 0,0 the n-th block is found as follows: The block can be split into two halves such that one occurrence of each number appears in each half. The first half of the n-th block begins with 3^n then increases by consecutive integers until the maximum for that block: (3^(n+1) - 3)/2, before abruptly dropping to (3^n - 1)/2 and increasing by consecutive integers until (3^n - 1) is reached. The second half of the n-th block is then defined by the original constraints.

Examples

			From the first and second appearances of 5 the sequence is 5, 6, 7, 8, 4, 9, 5 and as such has five numbers between the two 5's.
		

Crossrefs

A337596 Largest m such that k^n (mod m) is always either 0, +1, or -1.

Original entry on oeis.org

3, 5, 9, 16, 11, 13, 4, 32, 27, 25, 23, 16, 4, 29, 31, 64, 4, 37, 4, 41, 49, 23, 47, 32, 11, 53, 81, 29, 59, 61, 4, 128, 67, 8, 71, 73, 4, 8, 79, 41, 83, 49, 4, 89, 31, 47, 4, 97, 4, 125, 103, 53, 107, 109, 121, 113, 9, 59, 4, 61, 4, 8, 127, 256, 131, 67, 4, 137
Offset: 1

Author

Elliott Line, Sep 02 2020

Keywords

Comments

For a given n, for all k, k^n mod a(n) will always be either 0, 1 or a(n)-1. This will not be true for numbers larger than a(n).
It appears that a(m) = 4 for m in A045979. - Michel Marcus, Sep 04 2020

Examples

			For n = 5 all fifth powers of natural numbers: 1,32,243,1024, etc. are either a multiple of 11, or 1 greater or 1 less than a multiple of 11. There is no greater number than 11 for which all fifth powers are at most 1 different from a multiple. So a(5) = 11.
		

Crossrefs

Cf. residues: A096008 (for n=2), A096087 (for n=3).

Extensions

More terms from Michel Marcus, Sep 04 2020

A307116 A special version of Pascal's triangle where only Fibonacci numbers are permitted.

Original entry on oeis.org

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

Author

Elliott Line, Mar 25 2019

Keywords

Comments

If the sum of the two numbers above in the triangular array is not a Fibonacci number (A000045), then a 1 is put in its place.
A307069(k) is the row number of the first instance of the k-th Fibonacci number.

Examples

			The first few rows are as follows:
  row 0:            1
  row 1:           1 1
  row 2:          1 2 1
  row 3:         1 3 3 1
  row 4:        1 1 1 1 1
  row 5:       1 2 2 2 2 1
  row 6:      1 3 1 1 1 3 1
  row 7:     1 1 1 2 2 1 1 1
  row 8:    1 2 2 3 1 3 2 2 1
  row 9:   1 3 1 5 1 1 5 1 3 1
		

Crossrefs

Programs

  • Mathematica
    With[{s = Array[Fibonacci, 12]}, Nest[Append[#, Join[{1}, Map[Total[#] /. k_ /; FreeQ[s, k] -> 1 &, Partition[#[[-1]], 2, 1]], {1}]] &, {{1}}, 12]] // Flatten (* Michael De Vlieger, Mar 28 2019 *)
  • PARI
    isfib(n) = my(k=n^2); k+=(k+1)<<2; issquare(k) || (n>0 && issquare(k-8));
    rows(nn) = {v = [1]; print(v); if (nn == 1, return); v = [1, 1]; print(v); if (nn == 2, return); for (n=3, nn, w = vector(n); w[1] = v[1]; for (j=2, n-1, w[j] = v[j-1]+ v[j]; if (!isfib(w[j]), w[j] = 1);); w[n] = v[n-1]; print(w); v = w;);} \\ Michel Marcus, Mar 28 2019

A307069 Given a special version of Pascal's triangle where only Fibonacci numbers are permitted, a(n) is the row number in which the n-th Fibonacci number first appears.

Original entry on oeis.org

0, 0, 2, 3, 9, 50, 51, 70, 71, 133, 134, 135, 136, 2543, 2544
Offset: 1

Author

Elliott Line, Mar 22 2019

Keywords

Comments

Consider a version of Pascal's Triangle: a triangular array with a single 1 on row 0, with numbers below equal to the sum of the two numbers above it if and only if that sum appears in the Fibonacci sequence A000045. If the sum does not appear in A000045, a 1 is put in its place.
So the first few rows would be as follows:
row 0: 1
row 1: 1 1
row 2: 1 2 1
row 3: 1 3 3 1
row 4: 1 1 1 1 1
row 5: 1 2 2 2 2 1
row 6: 1 3 1 1 1 3 1
row 7: 1 1 1 2 2 1 1 1
row 8: 1 2 2 3 1 3 2 2 1
row 9: 1 3 1 5 1 1 5 1 3 1
...
a(n) is the row number in which the n-th Fibonacci number first appears in this triangular array.
a(16) > 2.2*10^5. - David A. Corneth, Mar 25 2019
a(16) > 3.2*10^6. - Daniel Suteu, Mar 26 2019
a(16) > 1.5*10^7. - Bert Dobbelaere, Apr 02 2019

Crossrefs

Cf. A000045, A307116 (the special Pascal's triangle).

Programs

  • Mathematica
    Block[{s = Array[Fibonacci, 20], t}, t = Nest[Append[#1, (PadLeft[#1[[-1]], #2] + PadRight[#1[[-1]], #2]) /. k_Integer /; FreeQ[s, k] -> 1] & @@ {#, Length@ # + 1} &, {{1}}, 10^4]; -1 + TakeWhile[Map[FirstPosition[t, #][[1]] &, s], IntegerQ]] (* Michael De Vlieger, Mar 24 2019 *)
  • PARI
    isfib(n) = my(k=n^2); k+=(k+1)<<2; issquare(k) || (n>0 && issquare(k-8));
    lista(nn) = {print1(0, ", ", 0, ", "); v = [1,1]; nextf = 3; for (n=2, nn, w = vector(n+1); w[1] = v[1]; for (j=2, n, w[j] = v[j-1]+ v[j]; if (!isfib(w[j]), w[j] = 1)); w[n+1] = v[n]; sw = vecsort(w,,8); if (vecsearch(sw, fibonacci(nextf)), print1(n, ", "); nextf++); v = w;);} \\ Michel Marcus, Mar 22 2019
    
  • PARI
    See Corneth link \\ David A. Corneth, Mar 25 2019

Extensions

a(14)-a(15) from Michel Marcus, Mar 22 2019

A280983 The complete list of numbers k such that precisely half of the numbers from 1 to k contain consecutive repeated digits.

Original entry on oeis.org

11824560, 14283650, 14283666, 14283672, 14422716, 14872610, 14872612, 14881986, 14917048, 22453380, 29875904, 29877516, 29878760, 29878776, 29878782, 29878812, 29879052, 29880432, 31852820, 31852822, 31888098, 31894108, 31894110, 31894130, 32255514, 32527482, 32557320, 32565868, 32565888, 32565890, 32566068, 32568748, 32568822, 32569040, 33082200
Offset: 1

Author

Elliott Line, Jan 11 2017

Keywords

Comments

Consider a function f(n), which looks at all of the numbers from 1 to n, counts up how many contain consecutive repeated digits, and how many do not, and subtracts the former count from the latter count. For all numbers less than 11824560, f(n) is positive; for all numbers greater than 33082200, f(n) is negative. In between, the function crosses the zero line several times, with the 35 numbers in this sequence being the only values for which f(n)=0.

Examples

			Among the 29878776 numbers up to and including 29878776, 14939388 contain at least one pair of consecutive digits that are identical, and 14939388 contain no such pair.
Of the six numbers that follow 29878776, 3 have consecutive repeated digits and 3 do not, so therefore 29878782 is also in this list.
		

A273013 Number of different arrangements of nonnegative integers on a pair of n-sided dice such that the dice can add to any integer from 0 to n^2-1.

Original entry on oeis.org

1, 1, 1, 3, 1, 7, 1, 10, 3, 7, 1, 42, 1, 7, 7, 35, 1, 42, 1, 42, 7, 7, 1, 230, 3, 7, 10, 42, 1, 115, 1, 126, 7, 7, 7, 393, 1, 7, 7, 230, 1, 115, 1, 42, 42, 7, 1, 1190, 3, 42, 7, 42, 1, 230, 7, 230, 7, 7, 1, 1158, 1, 7, 42, 462, 7, 115, 1, 42, 7, 115, 1, 3030
Offset: 1

Author

Elliott Line, May 13 2016

Keywords

Comments

The set of b values (see formula), and therefore also a(n), depends only on the prime signature of n. So, for example, a(24) will be identical to a(n) of any other n which is also of the form p_1^3*p_2, (e.g., 40, 54, 56).
The value of b_1 will always be 1. When n is prime, the only nonzero b will be b_1, so therefore a(n) will be 1.
In any arrangement, both dice will have a 0, and one will have a 1 (here called the lead die). To determine any one of the actual arrangements to numbers on the dice, select one of the permutations of divisors (for the lead die), then select another permutation that is either the same length as that of the lead die, or one less. For example, if n = 12, we might select 2*3*2 for the lead die, and 3*4 for the second die. These numbers effectively tell you when to "switch track" when numbering the dice, and will uniquely result in the numbering: (0,1,6,7,12,13,72,73,78,79,84,85; 0,2,4,18,20,22,36,38,40,54,56,58).
a(n) is the number of (unordered) pairs of polynomials c(x) = x^c_1 + x^c_2 + ... + x^c_n, d(x) = x^d_1 + x^d_2 + ... + x^d_n with nonnegative integer exponents such that c(x)*d(x) = (x^(n^2)-1)/(x-1). - Alois P. Heinz, May 13 2016
a(n) is also the number of principal reversible squares of order n. - S. Harry White, May 19 2018
From Gus Wiseman, Oct 29 2021: (Start)
Also the number of ordered factorizations of n^2 with alternating product 1. This follows from the author's formula. Taking n instead of n^2 gives a(sqrt(n)) if n is a perfect square, otherwise 0. Here, an ordered factorization of n is a sequence of positive integers > 1 with product n, and the alternating product of a sequence (y_1,...,y_k) is Product_i y_i^((-1)^(i-1)). For example, the a(1) = 1 through a(9) = 3 factorizations are:
() (22) (33) (44) (55) (66) (77) (88) (99)
(242) (263) (284) (393)
(2222) (362) (482) (3333)
(2233) (2244)
(2332) (2442)
(3223) (4224)
(3322) (4422)
(22242)
(24222)
(222222)
The even-length case is A347464.
(End)

Examples

			When n = 4, a(n) = 3; the three arrangements are (0,1,2,3; 0,4,8,12), (0,1,4,5; 0,2,8,10), (0,1,8,9; 0,2,4,6).
When n = 5, a(n) = 1; the sole arrangement is (0,1,2,3,4; 0,5,10,15,20).
		

Crossrefs

Positions of 1's are 1 and A000040.
A000290 lists squares, complement A000037.
A001055 counts factorizations, ordered A074206.
A119620 counts partitions with alternating product 1, ranked by A028982.
A339846 counts even-length factorizations, ordered A174725.
A339890 counts odd-length factorizations, ordered A174726.
A347438 counts factorizations with alternating product 1.
A347460 counts possible alternating products of factorizations.
A347463 counts ordered factorizations with integer alternating product.
A347466 counts factorizations of n^2.

Programs

  • Mathematica
    facs[n_] := If[n <= 1, {{}}, Join@@Table[Map[Prepend[#, d]&, Select[facs[n/d], Min@@# >= d&]], {d, Rest[Divisors[n]]}]];
    altprod[q_] := Product[q[[i]]^(-1)^(i-1), {i, Length[q]}];
    Table[Length[Select[Join@@Permutations/@facs[n^2], altprod[#] == 1&]],{n, 30}]
    (* Gus Wiseman, Oct 29 2021 *)
    (* or *)
    ofc[n_,k_] := If[k > PrimeOmega[n], 0, If[k == 0 && n == 1, 1, Sum[ofc[n/d, k-1],{d, Rest[Divisors[n]]}]]];
    Table[If[n == 1, 1, Sum[ofc[n, x]^2 + ofc[n, x]*ofc[n, x+1], {x, n}]],{n, 30}]
    (* Gus Wiseman, Oct 29 2021, based on author's formula *)
  • PARI
    A273013aux(n, k=0, t=1) = if(1==n, (1==t), my(s=0); fordiv(n, d, if((d>1), s += A273013aux(n/d, 1-k, t*(d^((-1)^k))))); (s));
    A273013(n) = A273013aux(n^2); \\ Antti Karttunen, Oct 30 2021
    
  • SageMath
    @cached_function
    def r(m,n):
        if n==1:
            return(1)
        divList = divisors(m)[:-1]
        return(sum(r(n,d) for d in divList))
    def A273013(n):
        return(r(n,n)) # William P. Orrick, Feb 19 2023

Formula

a(n) = b_1^2 + b_2^2 + b_3^2 + ... + b_1*b_2 + b_2*b_3 + b_3*b_4 + ..., where b_k is the number of different permutations of k divisors of n to achieve a product of n. For example, for n=24, b_3 = 9 (6 permutations of 2*3*4 and 3 permutations of 2*2*6).
a(n) = r(n,n) where r(m,1) = 1 and r(m,n) = Sum_{d|m,dWilliam P. Orrick, Feb 19 2023

A271040 Number of different 3 against 3 matches given n players.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 10, 70, 280, 840, 2100, 4620, 9240, 17160, 30030, 50050, 80080, 123760, 185640, 271320, 387600, 542640, 746130, 1009470, 1345960, 1771000, 2302300, 2960100, 3767400, 4750200, 5937750, 7362810, 9061920, 11075680, 13449040, 16231600, 19477920
Offset: 0

Author

Elliott Line, Mar 29 2016

Keywords

Comments

Given n players there are a(n) different ways of arranging those players in a 3 against 3 contest.
Number of ways to select two disjoint subsets of size 3 from a set of n elements. - Joerg Arndt, Mar 29 2016

Examples

			When there are 6 players, there are 10 different 3 against 3 matches that can be played: ABC v DEF, ABD v CEF, ABE v CDF, ABF v CDE, ACD v BEF, ACE v BDF, ACF v BDE, ADE v BCF, ADF v BCE, AEF v BCD.
		

Crossrefs

Cf. A050534, the analogous situation for 2 against 2 matches.

Programs

  • Mathematica
    LinearRecurrence[{7,-21,35,-35,21,-7,1},{0,0,0,0,0,0,10},40] (* Harvey P. Dale, Sep 17 2016 *)
  • PARI
    concat(vector(6), Vec(10*x^6/(1-x)^7 + O(x^50))) \\ Colin Barker, Mar 29 2016
    
  • PARI
    a(n)=binomial(n,3)*binomial(n-3,3)/2 \\ Charles R Greathouse IV, May 22 2018

Formula

a(n) = n*(n-1)*(n-2)*(n-3)*(n-4)*(n-5)/72.
a(n) = binomial(n,3) * binomial(n-3,3) / 2. - Joerg Arndt, Mar 29 2016
From Colin Barker, Mar 29 2016: (Start)
a(n) = 10*A000579(n).
a(n) = 7*a(n-1)-21*a(n-2)+35*a(n-3)-35*a(n-4)+21*a(n-5)-7*a(n-6)+a(n-7) for n>6.
G.f.: 10*x^6 / (1-x)^7.
(End)

A247397 Numbers n such that when n unit-diameter circles are arranged non-overlapping in the plane, and those circles are then enclosed in a rectangle, the area of the rectangle must be at least n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13
Offset: 1

Author

Elliott Line, Sep 16 2014

Keywords

Comments

For any number that does not appear on this list, there exists an arrangement of that number of unit-diameter circles that can be enclosed in a rectangle with area of less than 1 square unit per circle.
Any number of unit-diameter circles greater than or equal to 14 can be arranged in two rows, where the upper row is offset by 1/2 horizontally and (sqrt(3/4)-1) vertically, thereby reducing the minimum size of the enclosing rectangle to less than n square units. However, this isn't necessarily the overall minimum.
In addition, 11 unit-diameter circles placed in 3 rows can be enclosed in an area less than 11 square units.

Examples

			11 unit-diameter circles can be placed in a hexagonal array, with rows of 4, 3 and 4 circles in respective rows, which can be enclosed in a rectangle 4 units wide and (1+sqrt(3)) high, giving an area of 10.93, less than 11 square units. Any fewer circles than this, and also 12 or 13 circles, cannot be enclosed in a rectangle smaller than n square units in area.
		

A247374 Number of button presses required to try every combination of a binary combination lock with n number buttons.

Original entry on oeis.org

3, 8, 17, 38, 77, 165, 331, 698, 1397, 2921, 5843, 12149, 24299, 50315, 100631, 207698, 415397, 855105, 1710211, 3512801, 7025603, 14403923, 28807847, 58967773, 117935547, 241071395, 482142791, 984343883, 1968687767, 4014934295, 8029868591, 16360277378, 32720554757, 66607912625, 133215825251, 270969218153
Offset: 1

Author

Elliott Line, Sep 15 2014

Keywords

Comments

This type of lock is quite common in the real world. The lock has typically 13 'number' buttons (actually 0 1 2 3 4 5 6 7 8 9 X Y Z), plus a C (for clear) button, and a knob to turn to 'try' the combination. The way it functions is that the unlocking code is an n-digit binary number. By pressing one of the number buttons, you change the corresponding digit from 0 to 1. Pressing C reverts all digits to 0.

Examples

			A lock with four number buttons (plus try and clear) would have 16 combinations to try, namely 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111.
All combinations can be tried in 38 presses using the following sequence of presses:
T 1 T 2 T 3 T 4 T C 2 T 3 T 4 T C 3 T 4 T 1 T C 4 T 1 T 2 T C 1 3 T C 2 4 T. The T (tries) will attempt the combinations in the following order: 0000, 1000, 1100, 1110, 1111, 0100, 0110, 0111, 0010, 0011, 1011, 0001, 1001, 1101, 1010, 0101.
		

Crossrefs

Formula

a(n) = A000079(n) + A014495(n) + A014314(n). A000079 is how many times the 'try' button (or knob) is pressed. A014495 is how many times the C (clear) button is pressed. A014314 is how many times the number buttons are pressed.
Conjectured to be D-finite with recurrence: n*a(n) +2*(-2*n+1)*a(n-1) +(n-2)*a(n-2) +2*(7*n-10)*a(n-3) +4*(-5*n+11)*a(n-4) +8*(n-3)*a(n-5)=0. - R. J. Mathar, Nov 19 2019