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: César Eliud Lozada

César Eliud Lozada's wiki page.

César Eliud Lozada has authored 34 sequences. Here are the ten most recent ones:

A371654 Numbers that are not multiples of 10 and that yield a prime if their digits are arranged in ascending order.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 32, 37, 47, 59, 67, 71, 73, 74, 76, 79, 89, 91, 92, 95, 97, 98, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 157, 167, 172, 173, 175, 176, 179, 193, 194, 197, 199, 203, 209, 217, 223, 227, 229, 232, 233, 239, 257
Offset: 1

Author

César Eliud Lozada, Apr 01 2024

Keywords

Comments

If N is a term then all numbers with the same digits as N are terms too.

Examples

			91 is a term because arranging its digits in ascending order yields 19, which is a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[500],  Mod[#, 10] != 0 && PrimeQ[FromDigits[Sort[IntegerDigits[#]]]] &]
  • Python
    from sympy import isprime
    def ok(n): return n%10 and isprime(int("".join(sorted(str(n)))))
    print([k for k in range(260) if ok(k)]) # Michael S. Branicky, Apr 01 2024
    
  • Python
    from itertools import count, islice, combinations_with_replacement
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations
    def A371654_gen(): # generator of terms
        for l in count(1):
            xlist = []
            for p in combinations_with_replacement('0123456789',l):
                if isprime(int(''.join(p))):
                    xlist.extend(int(''.join(d)) for d in multiset_permutations(p) if d[0] != '0' and d[-1] != '0')
            yield from sorted(xlist)
    A371654_list = list(islice(A371654_gen(),20)) # Chai Wah Wu, Apr 10 2024

A371653 Numbers k such that the number formed by putting the digits of k in descending order is prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 14, 16, 17, 31, 34, 35, 37, 38, 41, 43, 53, 61, 71, 73, 79, 83, 97, 112, 113, 118, 119, 121, 124, 125, 128, 131, 133, 134, 136, 142, 143, 145, 146, 149, 152, 154, 157, 163, 164, 166, 167, 175, 176, 179, 181, 182, 188, 191, 194, 197, 199
Offset: 1

Author

César Eliud Lozada, Apr 01 2024

Keywords

Comments

Numbers k such that A004186(k) is prime. - Robert Israel, Apr 01 2024
If N is a term then all numbers with the same digits as N are terms too.

Examples

			142 is a term because its digits in decreasing order form 421 and this is prime.
		

Crossrefs

Programs

  • Maple
    dd:= proc(n) local L,i;
       L:= sort(convert(n,base,10));
       add(L[i]*10^(i-1),i=1..nops(L))
    end proc:
    select(isprime @ dd, [$1..1000]); # Robert Israel, Apr 01 2024
  • Mathematica
    Select[Range[500], PrimeQ[FromDigits[ReverseSort[IntegerDigits[#]]]] &]
  • Python
    from sympy import isprime
    def ok(n): return isprime(int("".join(sorted(str(n), reverse=True))))
    print([k for k in range(200) if ok(k)]) # Michael S. Branicky, Apr 01 2024
    
  • Python
    from itertools import count, islice, combinations_with_replacement
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations
    def A371653_gen(): # generator of terms
        for l in count(1):
            xlist = []
            for p in combinations_with_replacement('987654321',l):
                if isprime(int(''.join(p))):
                    xlist.extend(int(''.join(d)) for d in multiset_permutations(p))
            yield from sorted(xlist)
    A371653_list = list(islice(A371653_gen(),30)) # Chai Wah Wu, Apr 10 2024

A371031 Number of distinct integers resulting from adding an n-digit non-multiple of 10 and its reverse.

Original entry on oeis.org

9, 17, 170, 323, 3230, 6137, 61370, 116603, 1166030, 2215457
Offset: 1

Author

César Eliud Lozada, Mar 08 2024

Keywords

Examples

			For n=2 there are 81 2-digit numbers not ending with 0: {11, 12, 13, ..., 99}. There are 17 distinct results when adding each of these to their reversal: {22, 33, 44, 55, 66, 77, 88, 99, 110, 121, 132, 143, 154, 165, 176, 187, 198}. Therefore a(2) = 17.
		

Crossrefs

Programs

  • Mathematica
    A371031[n_] :=
    Module[{nn, ss},
      nn = Select[Range[If[n == 1, 1, 10^(n - 1) + 1], 10^n - 1], Mod[#, 10] > 0 &];
      ss = Map[# + FromDigits[Reverse[IntegerDigits[#]]] &, nn];
      Return[CountDistinct[ss]]
    ];
    Map[A371031[#]&, Range[7]]

Formula

For n > 1, empirically a(n+1) = 10 a(n) if n even, 19 a(n) / 10 if n odd, and thus a(n+2) = 19 a(n). - Michael S. Branicky, Mar 31 2024

Extensions

a(9)-a(10) from Michael S. Branicky, Mar 30 2024

A348410 Number of nonnegative integer solutions to n = Sum_{i=1..n} (a_i + b_i), with b_i even.

Original entry on oeis.org

1, 1, 5, 19, 85, 376, 1715, 7890, 36693, 171820, 809380, 3830619, 18201235, 86770516, 414836210, 1988138644, 9548771157, 45948159420, 221470766204, 1069091485500, 5167705849460, 25009724705460, 121171296320475, 587662804774890, 2852708925078675, 13859743127937876
Offset: 0

Author

César Eliud Lozada, Oct 17 2021

Keywords

Comments

Suppose n objects are to be distributed into 2n baskets, half of these white and half black. White baskets may contain 0 or any number of objects, while black baskets may contain 0 or an even number of objects. a(n) is the number of distinct possible distributions.

Examples

			Some examples (semicolon separates white basket from black baskets):
For n=1: {{1 ; 0}} - Total possible ways: 1.
For n=2: {{0, 0 ; 0, 2}, {0, 0 ; 2, 0}, {0, 2 ; 0, 0}, {1, 1 ; 0, 0}, {2, 0 ; 0, 0}} - Total possible ways: 5.
		

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(t=0, 1-signum(n),
          add(b(n-j, t-1)*(1+iquo(j, 2)), j=0..n))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..25);  # Alois P. Heinz, Oct 17 2021
  • Mathematica
    (* giveList=True produces the list of solutions *)
    (* giveList=False gives the number of solutions *)
    counter[objects_, giveList_: False] :=
      Module[{n = objects, nb, eq1, eqa, eqb, eqs, var, sol, var2, list},
       nb = n;
       eq1 = {Total[Map[a[#] + 2*b[#] &, Range[nb]]] - n == 0};
       eqa = {And @@ Map[0 <= a[#] <= n &, Range[nb]]};
       eqb = {And @@ Map[0 <= b[#] <= n &, Range[nb]]};
       eqs = {And @@ Join[eq1, eqa, eqb]};
       var = Flatten[Map[{a[#], b[#]} &, Range[nb]]];
       var = Join[Map[a[#] &, Range[nb]], Map[b[#] &, Range[nb]]];
       sol = Solve[eqs, var, Integers];
       var2 = Join[Map[a[#] &, Range[nb]], Map[2*b[#] &, Range[nb]]];
       list = Sort[Map[var2 /. # &, sol]];
       list = Map[StringReplace[ToString[#], {"," -> " ;"}, n] &, list];
       list = Map[StringReplace[#, {";" -> ","}, n - 1] &, list];
       Return[
        If[giveList, Print["Total: ", Length[list]]; list, Length[sol]]];
       ];
    (* second program: *)
    b[n_, t_] := b[n, t] = If[t == 0, 1 - Sign[n], Sum[b[n - j, t - 1]*(1 + Quotient[j, 2]), {j, 0, n}]];
    a[n_] := b[n, n];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Aug 16 2023, after Alois P. Heinz *)

Formula

Conjecture: D-finite with recurrence +7168*n*(2*n-1)*(n-1)*a(n) -64*(n-1)*(1759*n^2-5294*n+5112)*a(n-1) +12*(7561*n^3-75690*n^2+165271*n-101070)*a(n-2) +5*(110593*n^3-743946*n^2+1659971*n-1232778)*a(n-3) +2680*(4*n-15)*(2*n-7)*(4*n-13)*a(n-4)=0. - R. J. Mathar, Oct 19 2021
From Vaclav Kotesovec, Nov 01 2021: (Start)
Recurrence (of order 2): 16*(n-1)*n*(2*n - 1)*(51*n^2 - 162*n + 127)*a(n) = (n-1)*(5457*n^4 - 22791*n^3 + 32144*n^2 - 17536*n + 3072)*a(n-1) + 8*(2*n - 3)*(4*n - 7)*(4*n - 5)*(51*n^2 - 60*n + 16)*a(n-2).
a(n) ~ sqrt(3 + 5/sqrt(17)) * (107 + 51*sqrt(17))^n / (sqrt(Pi*n) * 2^(6*n+2)). (End)
From Peter Bala, Feb 21 2022: (Start)
a(n) = [x^n] ( (1 - x)*(1 - x^2) )^(-n). Cf. A234839.
a(n) = Sum_{k = 0..floor(n/2)} binomial(2*n-2*k-1,n-2*k)*binomial(n+k-1,k).
exp( Sum_{n >= 1} a(n)*x^n/n ) = 1 + x + 3*x^2 + 9*x^3 + 32*x^4 + 119*x^5 + ... is the g.f. of A063020.
The Gauss congruences a(n*p^k) == a(n*p^(k-1)) (mod p^k) hold for all primes p and positive integers n and k.
Conjecture: the supercongruences a(n*p^k) == a(n*p^(k-1)) (mod p^(3*k)) hold for all primes p >= 5 and positive integers n and k.
The o.g.f. A(x) is the diagonal of the bivariate rational function 1/(1 - t/((1-x)*(1-x^2))) and hence is an algebraic function over Q(x) by Stanley 1999, Theorem 6.33, p. 197.
Let F(x) = (1/x)*Series_Reversion( x*(1-x)*(1-x^2) ). Then A(x) = 1 + x*d/dx (log(F(x))). (End)
a(n) = Sum_{k = 0..n} (-1)^(n+k)*binomial(2*n+k-1, k)*binomial(2*n-k-1, n-k). Cf. A352373. - Peter Bala, Jun 05 2024

Extensions

More terms from Alois P. Heinz, Oct 17 2021

A336995 Numbers of the form x^3 + x^2*y + x*y^2 + y^3, where x and y are coprime positive integers.

Original entry on oeis.org

4, 15, 40, 65, 85, 156, 175, 203, 259, 272, 369, 400, 477, 580, 585, 671, 715, 803, 820, 888, 935, 1105, 1111, 1157, 1261, 1417, 1464, 1484, 1625, 1695, 1820, 1885, 2055, 2080, 2336, 2380, 2465, 2533, 2595, 2669, 2848, 2873, 2955, 3060, 3145, 3439, 3485, 3492
Offset: 1

Author

César Eliud Lozada, Aug 10 2020

Keywords

Comments

Equivalently, numbers of the form (x+y)*(x^2 + y^2) where x and y are coprime positive integers.

Examples

			For x=1, y=1, x^3+x^2*y+x*y^2+y^3 = 4, so 4 is in the sequence.
For x=1, y=2, x^3+x^2*y+x*y^2+y^3 = 15, so 15 is in the sequence.
For x=2, y=2, x^3+x^2*y+x*y^2+y^3 = 32, but GCD(x,y)<>1, so 32 is not in the sequence.
		

Crossrefs

Subsequence of A336607.

Programs

  • Maple
    N:= 10000: # for terms <= N
    S:= {}:
    for x from 1 while (x+1)*(x^2+1) < N do
       V:= select(`<=`,map(y -> (x+y)*(x^2+y^2), select(y -> igcd(x,y)=1, {seq(i,i=1..min(x,(N-x^3)/x^2))})),N);
       S:= S union V;
    od:
    sort(convert(S,list)); # Robert Israel, Sep 21 2020
  • Mathematica
    max = 5000; T0 = {}; xm = Ceiling[Sqrt[max]];
    While[T = T0;
    T0 = Table[x^3 + x^2 y + x y^2 + y^3, {x, 1, xm}, {y, x, xm}] //
         Flatten // Union // Select[#, # <= max &] &; T != T0, xm = 2 xm];
    T (* T=A336607 *)
    (* Now, exclude a(n) such that a(n)=k^3*a(m) for m=2 is an integer *)
    T2 = T; n = 1;
    While[n <= Length[T2],
      t1 = T2[[n]]; t2 = Last[T2]; max2 = 1 + (t2/t1)^(1/3);
      T2 = Complement[T2, Table[t1*k^3, {k, 2, max2}]];
      n++;
      ];
    T2 (* T2=A336995 *)
  • PARI
    upto(limit)={my(L=List(), b=sqrtnint(limit,3)); for(x=1, b, for(y=1, b, my(t=(x+y)*(x^2+y^2)); if(t<=limit && gcd(x,y)==1, listput(L,t)) )); Set(L)}
    upto(4000) \\ Andrew Howroyd, Aug 10 2020

A336607 Numbers of the form x^3 + x^2*y + x*y^2 + y^3, where x and y are positive integers.

Original entry on oeis.org

4, 15, 32, 40, 65, 85, 108, 120, 156, 175, 203, 256, 259, 272, 320, 369, 400, 405, 477, 500, 520, 580, 585, 671, 680, 715, 803, 820, 864, 888, 935, 960, 1080, 1105, 1111, 1157, 1248, 1261, 1372, 1400, 1417, 1464, 1484, 1624, 1625, 1695, 1755, 1820, 1875, 1885
Offset: 1

Author

César Eliud Lozada, Jul 27 2020

Keywords

Comments

Numbers of the form (x+y)(x^2+y^2), where x and y are positive integers. - Chai Wah Wu, Aug 08 2020
No terms == 2 (mod 4). - Robert Israel, Sep 21 2020

Examples

			4=1^3+1^2*1+1*1^2+1^3, 15=1^3+1^2*2+1*2^2+2^3, 32=2^3+2^2*2+2*2^2+2^3, ...
		

Crossrefs

Cf. A024614.

Programs

  • Maple
    N:= 10000: # for terms <= N
    S:= {}:
    for x from 1 while (x+1)*(x^2+1) < N do
       V:= select(`<=`,map(y -> (x+y)*(x^2+y^2), {seq(i,i=1..min(x,(N-x^3)/x^2))}),N);
       S:= S union V;
    od:
    sort(convert(S,list)); # Robert Israel, Sep 21 2020
  • Mathematica
    max = 5000; T0 = {}; xm = Ceiling[Sqrt[max]]; While[T = T0;
    T0 = Table[x^3 + x^2 y + x y^2 + y^3, {x, 1, xm}, {y, x, xm}] //
         Flatten // Union // Select[#, # <= max &] &; T != T0, xm = 2 xm];
    T

A331428 Divide each side of a triangle into 2*n-1 (n>=1) equal parts and trace the corresponding cevians, i.e., join every point, except for the first and last ones, with the opposite vertex. a(n) is the number of points at which three cevians meet.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 42, 0, 0, 0, 0, 12, 0, 0, 0, 48, 6, 0, 0, 0, 0, 6, 12, 0, 0, 0, 6, 0, 0, 12, 0, 0, 0, 24, 0, 0, 90, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 24, 0, 0, 0, 0, 12, 0, 0, 0, 12, 0
Offset: 1

Author

César Eliud Lozada, Jan 16 2020

Keywords

Comments

A bisection of A331423.

Crossrefs

Programs

  • Mathematica
    CevIntersections[n_] := Length[Solve[(n - i)*(n - j)*(n - k) - i*j*k == 0 && 0 < i < n &&  0 < j < n && 0 < k < n, {i, j, k}, Integers]];
    Map[CevIntersections[#] &, Range[1,51,2]]

Formula

a(n) = A331423(2*n-1).

A331425 Divide each side of a triangle into 2*n (n>=1) equal parts and trace the corresponding cevians, i.e., join every point, except for the first and last ones, with the opposite vertex. a(n) is the number of points at which three cevians meet.

Original entry on oeis.org

1, 7, 13, 19, 25, 31, 37, 43, 49, 61, 61, 91, 73, 79, 91, 91, 97, 103, 109, 133, 133, 127, 133, 187, 145, 151, 157, 175, 169, 235, 181, 187, 205, 199, 229, 283, 217, 223, 235, 325, 241, 283, 253, 271, 331, 271, 277, 343, 289, 301, 301, 319, 313, 319, 349, 439
Offset: 1

Author

César Eliud Lozada, Jan 16 2020

Keywords

Comments

A bisection of A331423.

Crossrefs

Programs

  • Mathematica
    CevIntersections[n_] := Length[Solve[(n - i)*(n - j)*(n - k) - i*j*k == 0 && 0 < i < n &&  0 < j < n && 0 < k < n, {i, j, k}, Integers]];
    Map[CevIntersections[#] &, Range[2,50,2]]

Formula

a(n) = A331423(2*n).

A331423 Divide each side of a triangle into n>=1 equal parts and trace the corresponding cevians, i.e., join every point, except for the first and last ones, with the opposite vertex. a(n) is the number of points at which three cevians meet.

Original entry on oeis.org

0, 1, 0, 7, 0, 13, 0, 19, 0, 25, 0, 31, 0, 37, 6, 43, 0, 49, 0, 61, 0, 61, 0, 91, 0, 73, 0, 79, 0, 91, 0, 91, 0, 97, 12, 103, 0, 109, 0, 133, 0, 133, 0, 127, 42, 133, 0, 187, 0, 145, 0, 151, 0, 157, 12, 175, 0, 169, 0, 235, 0, 181, 48, 187, 6, 205, 0, 199, 0
Offset: 1

Author

César Eliud Lozada, Jan 16 2020

Keywords

Comments

Denote the cevians by a0, a1,...,an, b0, b1,...,bn, c0, c1,...,cn. For any given n, the indices (i,j,k) of (ai, bj, ck) meeting at a point are the integer solutions of:
n^3 - (i + j + k)*n^2 + (j*k + k*i + i*j)*n - 2*i*j*k = 0, with 0 < i, j, k < n
or, equivalently and shorter,
(n-i)*(n-j)*(n-k) - i*j*k = 0, with 0 < i, j, k < n.
From N. J. A. Sloane, Feb 14 2020: (Start)
Stated another way, a(n) = number of triples (i,j,k) in [1,n-1] X [1,n-1] X [1,n-1] such that (i/(n-i))*(j/(n-j))*(k/(n-k)) = 1.
This is the quantity N3 mentioned in A091908.
Indices of zeros are precisely all odd numbers except those listed in A332378.
(End)

Crossrefs

Cf. A091908, A332378. Bisections are A331425, A331428.

Programs

  • Maple
    Ceva:= proc(n) local a, i, j, k; a:=0;
    for i from 1 to n-1 do
    for j from 1 to n-1 do
    for k from 1 to n-1 do
    if i*j*k/((n-i)*(n-j)*(n-k)) = 1 then a:=a+1; fi;
    od: od: od: a; end;
    t1:=[seq(Ceva(n), n=1..80)];  # N. J. A. Sloane, Feb 14 2020
  • Mathematica
    CevIntersections[n_] := Length[Solve[(n - i)*(n - j)*(n - k) - i*j*k == 0 && 0 < i < n &&  0 < j < n && 0 < k < n, {i, j, k}, Integers]];
    Map[CevIntersections[#] &, Range[50]]
  • PARI
    A331423(n) = sum(i=1, n-1, sum(j=1, n-1, sum(k=1, n-1, (1==(i*j*k)/((n-i)*(n-j)*(n-k)))))); \\ (After the Maple program) - Antti Karttunen, Dec 12 2021

A307417 Numbers that can be expressed in a base in such a way that the sum of cubes of their digits in this base equals the original number.

Original entry on oeis.org

8, 9, 16, 17, 27, 28, 29, 35, 43, 54, 55, 62, 64, 65, 72, 91, 92, 99, 118, 125, 126, 127, 128, 133, 134, 152, 153, 189, 190, 216, 217, 224, 243, 244, 250, 251, 280, 307, 341, 342, 343, 344, 351, 370, 371, 407, 432, 433, 468, 469, 512, 513, 514, 520, 539, 559
Offset: 1

Author

César Eliud Lozada, Apr 07 2019

Keywords

Comments

There are infinitely many such numbers (proof in the second Johnson link).

Examples

			a(1) = 8 = [2, 0] (base 4) =  2^3 + 0^3
a(2) = 9 = [2, 1] (base 4) =  2^3 + 1^3
a(3) = 16 = [2, 2] (base 7) =  2^3 + 2^3
a(4) = 17 = [1, 2, 2] (base 3) =  1^3 + 2^3 + 2^3
		

Crossrefs

Programs

  • Maple
    sqn:= []; lis:=[];
    for n to 1000 do
      b := 2;
      while b < n do #needs to be adjusted
        q := convert(n, base, b);
        s := convert(map(proc (X) options operator, arrow; X^3 end proc, q), `+`);
        if evalb(s = n) then
          sqn := [op(sqn), n];
          lis := [op(lis), [n, b, ListTools[Reverse](q)]];
          break
        end if;
        b := b+1
      end do
    end do;
    lis := lis; #list of decompositions [number, base, conversion]
    sqn := sqn; #sequence