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: Luca Onnis

Luca Onnis's wiki page.

Luca Onnis has authored 21 sequences. Here are the ten most recent ones:

A362006 a(n) is the minimum integer m such that floor(e^n) = floor(Sum_{k=0..m} (n^k)/(k!)).

Original entry on oeis.org

0, 1, 4, 8, 9, 12, 15, 17, 19, 24, 25, 29, 30, 34, 37, 39, 41, 44, 48, 49, 52, 55, 59, 61, 62, 66, 68, 70, 74, 79, 79, 82, 84, 89, 89, 92, 96, 98, 102, 103, 106, 110, 112, 114, 116, 122, 124, 126, 128, 132, 133, 137, 138, 141, 144, 147, 151, 152, 154, 158, 161
Offset: 0

Author

Luca Onnis, Apr 03 2023

Keywords

Comments

Conjecture: a(n) ~ e*n as n->infinity.
Conjecture: a(n) <= 3n for all n.
The second one would imply: A000149(n) = floor(Sum_{k=0..3n} (n^k)/(k!)).

Examples

			a(3) = 8 since floor(e^3) = 20, floor(Sum_{k=0..8} (n^k)/(k!)) = 20 and "8" is the minimum because floor(Sum_{k=0..7} (n^k)/(k!)) = 19.
		

Crossrefs

Cf. A000149.

Programs

  • Mathematica
    f[n_, m_] := Floor[Sum[(n^k)/(k!), {k, 0, m}]] - Floor[E^n];
    a[n_] := Min[Flatten[Position[Table[f[n, m], {m, 0, 150}], 0]]] - 1;
    Table[a[n], {n, 1, 50}]
  • PARI
    a(n) = my(m=0, x=floor(exp(n)), y=1); while(floor(y) != x, m++; y += n^m/m!); m; \\ Michel Marcus, Apr 14 2023

A361233 Numbers k such that the "Pisano cycle modulo k shape" is bounded.

Original entry on oeis.org

1, 2, 4, 5, 6, 8, 10, 11, 12, 14, 16, 18, 19, 20, 22, 24, 28, 29, 30, 31, 32, 36, 37, 38, 40, 42, 44, 46, 48, 50, 52, 53, 54, 55, 56, 58, 59, 60, 62, 64, 66, 68, 70, 71, 72, 76, 78, 79, 80, 82, 84, 86, 88, 89, 90, 92, 94, 95, 96, 98, 100, 101, 102, 104, 106, 108, 109, 110, 112
Offset: 1

Author

Luca Onnis, Mar 05 2023

Keywords

Comments

Let k be a positive integer and consider the Pisano cycle of Fibonacci numbers modulo k. We define the "Pisano cycle modulo k shape" to be the 2-dimensional shape obtained by applying the following process:
Step 1: Start from the origin of a 2-dimensional grid.
Step 2: Consider the first number of the Pisano cycle: if it's 0, then stay still in the position you were before; otherwise, if it's even, then turn 90 degrees counterclockwise and take a 1-unit step; if it's odd, then turn 90 degrees clockwise and take a 1-unit step.
Step 3: Continue this process for all the numbers in the Pisano cycle modulo n.
Step 4: When you have applied the above rules to all the numbers, repeat the entire process again and again, each time starting from the position where the previous iteration ended.
Some shapes seem to repeat; for example, the shapes associated with k = 6, 12, 14 are the same.
The condition for being bounded is that after processing one iteration of the Pisano cycle then either current direction must be different from the initial direction or the current position must be the origin.

Examples

			For k = 2 the Pisano Cycle modulo 2 of the Fibonacci numbers is (1,1,0) and the shape obtained by iterating the process described above is a 1-unit square, which is bounded, so a(2) = 2.
		

Crossrefs

Programs

  • PARI
    \\ P(n) gives n-th row of A161553.
    P(n)={my(L=List([0]), X=Mod([1,1;1,0],n), I=Mod([1,0;0,1],n), M=X, k=1); while(M<>I, k++; M*=X; listput(L, lift(M[2,2]))); Vec(L)}
    isok(n)={my(s=P(n), x=0, y=0, dx=1, dy=0, t); for(i=1, #s, if(s[i], [dx,dy]=if(s[i]%2, [dy, -dx], [-dy, dx]); x+=dx; y+=dy)); (x==0&&y==0) || dx!=1}
    select(isok, [1..100]) \\ Andrew Howroyd, Mar 05 2023

A361627 Positive integers such that GCD(A007504(n),n) != 1.

Original entry on oeis.org

18, 23, 24, 25, 30, 36, 42, 53, 54, 56, 57, 63, 78, 84, 85, 90, 99, 105, 111, 117, 123, 126, 129, 138, 154, 170, 177, 180, 190, 195, 207, 213, 222, 228, 230, 237, 238, 240, 245, 246, 252, 258, 270, 273, 275, 276, 282, 288, 297, 299, 303, 304, 309, 318, 319, 322, 327, 333, 339, 345
Offset: 1

Author

Luca Onnis, Mar 18 2023

Keywords

Comments

A301274(k) != k implies that k is a term of this sequence.
Conjecture: a(n) ~ C*n as n -> infinity, where 5.25 < C < 5.35.

Examples

			18 is a term of this sequence since the sum of the first 18 primes is 501 and GCD(501,18) = 3 != 1.
		

Crossrefs

Programs

  • Mathematica
    s[n_] := Sum[Prime[k], {k, 1, n}];
    Complement[Table[n, {n, 1, 1000}], Flatten[Position[Table[GCD[s[n], n], {n, 1, 1000}], 1]]]
  • PARI
    isok(k) = gcd(vecsum(primes(k)), k) != 1; \\ Michel Marcus, Mar 18 2023
    
  • Python
    from math import gcd
    from itertools import count, islice
    from sympy import nextprime
    def A361627_gen(): # generator of terms
        p, s = 2, 2
        for n in count(1):
            if gcd(n,s) > 1:
                yield n
            s += (p:=nextprime(p))
    A361627_list = list(islice(A361627_gen(),20)) # Chai Wah Wu, Mar 22 2023

A361197 a(n) is the number of equations in the set {x^2 + 2y^2 = n, 2x^2 + 3y^2 = n, ..., k*x^2 + (k+1)*y^2 = n, ..., n*x^2 + (n+1)*y^2 = n} which admit at least one nonnegative integer solution.

Original entry on oeis.org

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

Author

Luca Onnis, Mar 04 2023

Keywords

Comments

Compared to the "linear" case given by A356770, the "quadratic" case given by this sequence has a more chaotic behavior.
a(n) >= 2 for all n > 1 since (n-1)*x^2 + n*y^2 = n and n*x^2 + (n+1)*y^2 = n always admit one integer solution (respectively (0,1) and (1,0)).
Conjecture: a(n) = 2 for infinitely many n.

Examples

			a(5) = 3. Consider the equations: x^2 + 2y^2 = 5, 2x^2 + 3y^2 = 5, 3x^2 + 4y^2 = 5, 4x^2 + 5y^2 = 5, 5x^2 + 6y^2 = 5. Only three of them admit at least one nonnegative integer solution, since 3x^2 + 4y^2 = 5 and x^2 + 2y^2 = 5 have no nonnegative integer solutions.
		

Crossrefs

Cf. A356770.

Programs

  • Mathematica
    b[m_] := m;
    f[n_] := Table[Dimensions[Solve[b[k]*x^2 + b[k + 1]*y^2 == n, {x, y}, NonNegativeIntegers]][[1]], {k, 1, n}];

A360365 a(n) = sum of the products of the digits of the first n positive multiples of 3.

Original entry on oeis.org

3, 9, 18, 20, 25, 33, 35, 43, 57, 57, 66, 84, 111, 119, 139, 171, 176, 196, 231, 231, 249, 285, 339, 353, 388, 444, 452, 484, 540, 540, 567, 621, 702, 702, 702, 702, 703, 707, 714, 714, 720, 732, 750, 756, 771, 795, 799, 815, 843, 843, 858, 888, 933, 945, 975, 1023, 1030, 1058, 1107
Offset: 1

Author

Luca Onnis, Feb 09 2023

Keywords

Examples

			a(4) = 20 since the first 4 positive multiples of 3 are 3,6,9 and 12 and the sum of the product of their digits is 3 + 6 + 9 + 1*2 = 20.
		

Crossrefs

Programs

  • Mathematica
    Accumulate[Times @@@ IntegerDigits[Range[3, 999 , 3]]]
  • PARI
    a(n)={sum(k=1, n, vecprod(digits(3*k)))} \\ Andrew Howroyd, Feb 09 2023
    
  • Python
    from math import prod
    def A360365(n): return sum(prod(int(d) for d in str(m)) for m in range(3,3*n+1,3)) # Chai Wah Wu, Feb 28 2023

Formula

a((10^n-1)/3) = (1/836)*(15*(19*45^n-63) + 44*3^((3*n)/2)*(sqrt(3)*sin((Pi*n)/6) + 15*cos((Pi*n)/6))).
G.f. of the subsequence a((10^n-1)/3): 9*(2 - 32*x + 135*x^2)/((1 - x)*(1 - 45*x)*(1 - 9*x + 27*x^2)).
a((10^n-1)/3) = 55*a((10^(n-1)-1)/3) - 486*a((10^(n-2)-1)/3) + 1647*a((10^(n-3)-1)/3) - 1215*a((10^(n-4)-1)/3) for n > 4.

A360559 Alternating partial sum of A006530.

Original entry on oeis.org

1, -1, 2, 0, 5, 2, 9, 7, 10, 5, 16, 13, 26, 19, 24, 22, 39, 36, 55, 50, 57, 46, 69, 66, 71, 58, 61, 54, 83, 78, 109, 107, 118, 101, 108, 105, 142, 123, 136, 131, 172, 165, 208, 197, 202, 179, 226, 223, 230, 225, 242, 229, 282, 279, 290, 283, 302, 273, 332, 327, 388, 357, 364, 362
Offset: 1

Author

Luca Onnis, Feb 11 2023

Keywords

Comments

a(2) = -1 is the only negative term of the sequence.

Examples

			a(4) = 0 since the greatest prime factors of {1,2,3,4} are {1,2,3,2} and the alternating sum 1-2+3-2 = 0.
		

Crossrefs

Programs

  • Mathematica
    a[k_] := Sum[(-1)^(n + 1)*ResourceFunction["LargestPrimeFactor"][n], {n, 1, k}]; Table[a[n], {n, 1, 64}]
    (* or *)
    Accumulate[Table[(-1)^(n + 1)*FactorInteger[n][[-1, 1]], {n, 1, 100}]] (* Vaclav Kotesovec, Aug 09 2025 *)
  • PARI
    a(n)=if(n>1, vecmax(factor(n)[, 1]), 1); s(k)=sum(n=1, k, a(n)*(-1)^(n+1))

Formula

a(n) ~ (Pi^2*n^2*log(n/4))/(24*log(n/2)*log(n)) as n -> infinity.

A357714 a(n) is the number of equations in the set E_{n,b} := {x+2^b*y=n^b, 2^b*x+3^b*y=n^b, ..., k^b*x+(k+1)^b*y=n^b, ..., n^b*x+(n+1)^b*y=n^b} which admit at least one nonnegative integer solution when b is sufficiently large.

Original entry on oeis.org

1, 2, 3, 4, 3, 5, 4, 6, 5, 6, 4, 8, 5, 7, 7, 8, 5, 9, 5, 9, 8, 8, 6, 12, 7, 8, 8, 10, 6, 12, 7, 11, 9, 9, 9, 14, 7, 9, 9, 13, 7, 13, 8, 12, 12, 10, 8, 16, 9, 12, 10, 12, 8, 14, 10, 14, 11, 11, 9, 19, 9, 11, 13, 14, 11, 15, 9, 13, 11, 15, 9, 19, 10, 12, 14, 14, 12, 16, 10, 18, 13
Offset: 1

Author

Luca Onnis, Oct 10 2022

Keywords

Comments

Defining a(n,b) as the number of equations of the set E_{n,b} which admit at least one nonnegative integer solution, it's possible to prove the existence of b_0 such that for all b > b_0, a(n,b) = a(n) whose value does not depend on b anymore.
a(n) is the number of positive integers k such that k(k+1) <= n or k divides n or k+1 divides n.

Examples

			a(11) = 4 since for all b >= 29 the number of equations of the set E_{11,b} which admit at least one nonnegative integer solution is exactly equal to 4.
a(4) = 4 since for all b >= 1 the number of equations of the set E_{11,b} which admit at least one nonnegative integer solution is exactly equal to 4.
		

Crossrefs

Programs

  • Mathematica
    Table[Ceiling[Sqrt[n] - 3/2] + Length[Divisors[n]], {n, 1, 100}]

Formula

a(n) = ceiling(sqrt(n) - 3/2) + A000005(n).
a(n) ~ A356770(n)/2 as n->infinity.
a(n) <= A356770(n) for all n >= 1.

A356770 a(n) is the number of equations in the set {x+2y=n, 2x+3y=n, ..., k*x+(k+1)*y=n, ..., n*x+(n+1)*y=n} which admit at least one nonnegative integer solution.

Original entry on oeis.org

1, 2, 3, 4, 4, 5, 5, 6, 6, 7, 6, 8, 7, 8, 8, 9, 8, 10, 8, 10, 10, 10, 9, 12, 10, 11, 11, 12, 10, 13, 11, 13, 12, 12, 12, 15, 12, 13, 13, 15, 12, 15, 13, 15, 15, 14, 13, 17, 14, 16, 15, 16, 14, 17, 15, 17, 16, 16, 15, 20, 15, 16, 17, 18, 17, 19, 16, 18, 17, 19, 16, 21, 17, 18, 19, 19
Offset: 1

Author

Luca Onnis, Aug 27 2022

Keywords

Comments

a(n) = ceiling(2*(sqrt(n)-1)) + ceiling(A000005(n)/2).

Examples

			a(5) = 4. Consider the equations: x+2y=5, 2x+3y=5, 3x+4y=5, 4x+5y=5, 5x+6y=5. Only four of them admit at least one nonnegative integer solution, since 3x+4y=5 has no nonnegative integer solution.
		

Crossrefs

Cf. A000005.

Programs

  • Mathematica
    b[m_] := m;
    f[n_] := Table[Dimensions[Solve[b[k]*x + b[k + 1]*y == n, {x, y}, NonNegativeIntegers]][[1]], {k, 1, n}];
    Flatten[Table[Dimensions[DeleteCases[f[k], 0]], {k, 1, 100}]]

A355571 Complement of A007956: numbers not of the form P(k)/k where P(n) is the product of the divisors of n.

Original entry on oeis.org

4, 9, 12, 16, 18, 20, 24, 25, 28, 30, 32, 36, 40, 42, 44, 45, 48, 49, 50, 52, 54, 56, 60, 63, 66, 68, 70, 72, 75, 76, 78, 80, 81, 84, 88, 90, 92, 96, 98, 99, 100, 102, 104, 105, 108, 110, 112, 114, 116, 117, 120, 121, 124, 126, 128, 130, 132, 135, 136, 138, 140, 147, 148, 150, 152
Offset: 1

Author

Luca Onnis, Jul 07 2022

Keywords

Comments

There are no primes in the sequence, since A007956(p^2) = p for all primes p.
There are infinitely many terms, in fact p^2 is a term for all primes p.
If 8k+1 is not a perfect square, then p^k is a term for all primes p.
Depends only on the prime signature: n is in this sequence if and only if A046523(n) is in this sequence. - Charles R Greathouse IV, Jul 08 2022
Contains all the weak numbers (A052485) aside from the primes (A000040) and squarefree semiprimes (A006881). - Charles R Greathouse IV, Jul 08 2022

Examples

			4 is a term of this sequence because there are no numbers k such that A007956(k) = 4.
2^10 is not a term of this sequence because A007956(32) = 1024 (Note that 8*10+1=81=9^2 is a perfect square).
p^4 belongs to this sequence for all primes p, in fact 8*4+1=33 is not a perfect square, so there are no numbers h such that A007956(h) = p^4.
		

References

  • Wacław Sierpiński, Elementary Theory of Numbers, Ex. 2 p. 174, Warsaw, 1964.

Crossrefs

Subsequences by prime signature: A001248 (p^2), A054753 (p^2*q), A030514 (p^4), A065036 (p^3*q), A007304 (p*q*r), A050997 (p^5), A085986 (p^2*q^2).

Programs

  • Mathematica
    Complement[Complement[Table[n, {n, 2, 1000}], Select[NumericalSort[Table[Times @@ Most[Divisors[n]], {n, 1000000}]], # != 1 && # < 1000 &]], Select[Table[Prime[n], {n, 1, 1000}], # < 1000 &]]

Formula

a(n) = n + O(n log log n/log n). - Charles R Greathouse IV, Jul 08 2022

A350710 Triangle read by rows formed from the coefficients in ascending order of the characteristic polynomial of the n X n matrix M(n) with entries M(n)[i,j] = i*j mod n+1.

Original entry on oeis.org

1, -1, 1, -3, -2, 1, -16, -16, -2, 1, 0, 100, -10, -10, 1, -1296, 0, 324, -24, -13, 1, 0, 0, 4116, 392, -175, -14, 1, 0, -131072, 16384, 12288, -512, -352, -12, 1, 0, 0, -708588, 0, 44469, 2592, -459, -24, 1, 0, 0, 16000000, 800000, -760000, -12000, 11000, -100, -45, 1
Offset: 0

Author

Luca Onnis, Mar 27 2022

Keywords

Examples

			Triangle begins:
n=0:     1;
n=1:    -1,   1;
n=2:    -3,  -2,    1;
n=3:   -16, -16,   -2,   1;
n=4:     0, 100,  -10, -10,    1;
n=5: -1296,   0,  324, -24,  -13,   1;
n=6:     0,   0, 4116, 392, -175, -14, 1;
For example, the characteristic polynomial associated to M(7) is
  q^7 - 12*q^6 - 352*q^5 - 512*q^4 + 12288*q^3 + 16384*q^2 - 131072*q + 0;
so the seventh row of the triangle is
  0, -131072, 16384, 12288, -512, -352, -12, 1.
		

Crossrefs

Cf. A352620 (matrices M).

Programs

  • Maple
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(LinearAlgebra[
        CharacteristicPolynomial](Matrix(n, (i, j)-> irem(i*j, n+1)), x)):
    seq(T(n), n=0..10);  # Alois P. Heinz, Mar 27 2022
  • Mathematica
    Table[(-1)^(p + 1)*CoefficientList[CharacteristicPolynomial[Table[Mod[k*Table[i, {i, 1, p - 1}], p], {k, 1, p - 1}], x], x], {p, 2, 20}]
  • PARI
    row(n) = Vecrev(charpoly(matrix(n,n,i,j,i*j%(n+1)))); \\ Kevin Ryde, Mar 27 2022