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.

Previous Showing 51-60 of 422 results. Next

A387423 The length of binary expansion of n minus the length of the maximal common prefix of the binary expansions of n and sigma(n), where sigma is the sum of divisors function.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 01 2025

Keywords

Comments

Positions of 0's in this sequence is given by such numbers n that sigma(n) = 2^k * n + r, for some n >= 1, k >= 0, 0 <= r < 2^k. These would include also quasi-perfect numbers and their generalizations, numbers n such that sigma(n) = 2^k * n + 2^k - 1, for some n > 1, k > 0 (see comments in A332223), if such numbers exist. However, it is conjectured that there are no other zeros than those given by A336702.

Crossrefs

Cf. A000203, A000523, A332223, A336700, A336701, A336702 (conjectured positions of 0's), A387422.
Cf. also A347381, A387413.

Programs

  • Mathematica
    A387423[n_] := BitLength[n] - LengthWhile[Transpose[IntegerDigits[{n, DivisorSigma[1, n]}, 2][[All, ;; BitLength[n]]]], Equal @@ # &];
    Array[A387423, 100] (* Paolo Xausa, Sep 03 2025 *)
  • PARI
    A387423(n) = { my(a=binary(n), b=binary(sigma(n)), i=1); while(i<=#a,if(a[i]!=b[i],return(#a-(i-1))); i++); (0); };
    
  • Python
    from os.path import commonprefix
    from sympy import divisor_sigma
    def A387423(n): return n.bit_length()-len(commonprefix([bin(n)[2:],bin(divisor_sigma(n))[2:]])) # Chai Wah Wu, Sep 03 2025

Formula

a(n) = (1+A000523(n)) - A387422(n).

A387480 a(n) = Sum_{k=0..n} 3^k * 2^(n-k) * binomial(k,n-k)^2.

Original entry on oeis.org

1, 3, 15, 99, 603, 3807, 24759, 162243, 1072683, 7147359, 47887767, 322330995, 2178055899, 14765637663, 100380161655, 684061007139, 4671543976587, 31962145170015, 219043736154711, 1503380943222867, 10332034575214779, 71092843087100319, 489712662842798007
Offset: 0

Views

Author

Seiichi Manyama, Aug 30 2025

Keywords

Crossrefs

Programs

  • Magma
    [&+[3^k * 2^(n-k) * Binomial(k, n-k)^2: k in [0..n]]: n in [0..25]]; // Vincenzo Librandi, Sep 01 2025
  • Mathematica
    Table[Sum[3^k*2^(n-k)*Binomial[k,n-k]^2,{k,0,n}],{n,0,25}] (* Vincenzo Librandi, Sep 01 2025 *)
  • PARI
    a(n) = sum(k=0, n, 3^k*2^(n-k)*binomial(k, n-k)^2);
    

Formula

G.f.: 1/sqrt((1-3*x-6*x^2)^2 - 72*x^3).

A387481 a(n) = Sum_{k=0..floor(n/2)} 3^k * 2^(n-2*k) * binomial(k,n-2*k)^2.

Original entry on oeis.org

1, 0, 3, 6, 9, 72, 63, 486, 1053, 2808, 11907, 22518, 99225, 246888, 755487, 2554902, 6488829, 23112216, 63506835, 198653958, 623336553, 1781565192, 5807475711, 16898655942, 52699192029, 161995971384, 484990399395, 1525112887446, 4572778238649, 14184781485480, 43472894580063
Offset: 0

Views

Author

Seiichi Manyama, Aug 30 2025

Keywords

Crossrefs

Programs

  • Magma
    [(&+[3^k * 2^(n-2*k)* Binomial(k,n-2*k)^2: k in [0..Floor(n/2)]]): n in [0..40]]; // Vincenzo Librandi, Sep 01 2025
  • Mathematica
    Table[Sum[3^k * 2^(n-2*k)*Binomial[k,n-2*k]^2,{k,0,Floor[n/2]}],{n,0,40}] (* Vincenzo Librandi, Sep 01 2025 *)
  • PARI
    a(n) = sum(k=0, n\2, 3^k*2^(n-2*k)*binomial(k, n-2*k)^2);
    

Formula

G.f.: 1/sqrt((1-3*x^2-6*x^3)^2 - 72*x^5).

A387484 a(n) = Sum_{k=0..floor(n/3)} 2^(n-k) * binomial(k,n-3*k)^2.

Original entry on oeis.org

1, 0, 0, 4, 8, 0, 16, 128, 64, 64, 1152, 2304, 768, 8192, 36864, 33792, 55296, 409600, 823296, 704512, 3719168, 13123584, 16351232, 33619968, 160890880, 329515008, 436731904, 1695809536, 5182586880, 7935623168, 18086887424, 67335356416, 141687783424
Offset: 0

Views

Author

Seiichi Manyama, Aug 30 2025

Keywords

Crossrefs

Programs

  • Magma
    [(&+[2^(n-k)* Binomial(k,n-3*k)^2: k in [0..Floor(n/3)]]): n in [0..40]]; // Vincenzo Librandi, Sep 01 2025
  • Mathematica
    Table[Sum[2^(n-k)*Binomial[k,n-3*k]^2,{k,0,Floor[n/3]}],{n,0,40}] (* Vincenzo Librandi, Sep 01 2025 *)
  • PARI
    a(n) = sum(k=0, n\3, 2^(n-k)*binomial(k, n-3*k)^2);
    

Formula

G.f.: 1/sqrt((1-4*x^3-8*x^4)^2 - 128*x^7).

A387485 a(n) = Sum_{k=0..floor(n/3)} 2^(n-2*k) * binomial(k,n-3*k)^2.

Original entry on oeis.org

1, 0, 0, 2, 4, 0, 4, 32, 16, 8, 144, 288, 80, 512, 2304, 2080, 1856, 12800, 25664, 17408, 58624, 204928, 242944, 299520, 1258752, 2541568, 2609152, 6824448, 20169728, 28344320, 41747456, 132358144, 268472320, 349177856, 807964672, 2116296704, 3336458240
Offset: 0

Views

Author

Seiichi Manyama, Aug 30 2025

Keywords

Crossrefs

Programs

  • Magma
    [(&+[2^(n-2*k)* Binomial(k,n-3*k)^2: k in [0..Floor(n/3)]]): n in [0..40]]; // Vincenzo Librandi, Sep 01 2025
  • Mathematica
    Table[Sum[2^(n-2*k)*Binomial[k,n-3*k]^2,{k,0,Floor[n/3]}],{n,0,40}] (* Vincenzo Librandi, Sep 01 2025 *)
  • PARI
    a(n) = sum(k=0, n\3, 2^(n-2*k)*binomial(k, n-3*k)^2);
    

Formula

G.f.: 1/sqrt((1-2*x^3-4*x^4)^2 - 32*x^7).

A379049 a(n) = prime(i)*dp(n,i) + prime(i)*dn(n,i) where dp(n,i) = 1 when the i-th trit of n is 1, dn(n,i) = 1 when the i-th trit of n is T, and dp(n,i) = dn(n,i) = 0 when the i-th trit of n is 0.

Original entry on oeis.org

2, 3, 5, 4, 7, 11, 8, 13, 7, 6, 11, 17, 16, 31, 37, 22, 29, 17, 12, 19, 31, 26, 47, 13, 10, 17, 9, 8, 15, 23, 22, 43, 41, 38, 73, 37, 36, 71, 107, 106, 211, 221, 116, 127, 81, 46, 57, 103, 68, 101, 53, 32, 43, 25, 18, 29, 47, 40, 73, 97, 76, 131, 69, 62, 117
Offset: 0

Views

Author

Lei Zhou, Dec 14 2024

Keywords

Comments

The Balanced Ternary presentation of a number is a series of 1, 0, and T, where T represent -1. For example, 35 = 110T = 1 * 3^3 + 1* 3^2 + 0 * 3 - 1 = 27 + 9 + 0 - 1.
Conjecture: All positive integers greater than 1 appear in this sequence at least once.

Examples

			When n = 0, its BT presentation is 0, thus a(0) = 1 + 1 = 2;
When n = 1, its BT presentation is 1, the first prime is 2, thus a(1) = 2 + 1 = 3;
...
When n = 14, its BT presentation is 1TTT, thus prime 7 appears before the plus sign and primes 5, 3, and 2 appear in the term after the plus sign, a(14) = 7 + 5*3*2 = 37;
...
By the same rule, when n = 64, its BT presentation is 1T101, thus prime 11, 5, 2 appear before the plus sign and prime 7 appears in the term after the plus sign, a(64) = 11*5*2 + 7 = 117.
		

Crossrefs

Programs

  • Mathematica
    BTDigits[m_Integer, g_]:= Module[{n = m, d, sign, t = g}, If[n != 0, If[n > 0, sign = 1, sign = -1; n = -n]; d = Ceiling[Log[3, n]]; If[3^d - n <= ((3^d - 1)/2), d++]; While[Length[t] < d, PrependTo[t, 0]]; t[[Length[t] + 1 - d]] = sign; t = BTDigits[sign*(n - 3^(d - 1)), t]]; t];
    res = {}; Do[BT = BTDigits[i, {0}]; BTl = Length[BT]; f = 1; b = 1; Do[If[BT[[j]] == 1, f = f*Prime[BTl - j + 1]]; If[BT[[j]] == -1, b = b*Prime[BTl - j + 1]], {j, 1, BTl}];  d = f + b; AppendTo[res, d], {i, 0, 64}]; res
  • Python
    from sympy import prime
    def A140267(n): # see A140267
        return
    def A379049(n):
        x,y,z = 1,1,str(A140267(n))[::-1]
        for i in range(len(z)):
            if z[i] == "1":
                x *= prime(i+1)
            if z[i] == "2":
                y *= prime(i+1)
        return x+y # John Tyler Rascoe, Feb 27 2025

A383904 a(n) is the number of complement pairs of primitive 2n-bead balanced binary necklaces.

Original entry on oeis.org

0, 0, 0, 1, 3, 11, 35, 118, 392, 1336, 4587, 15986, 56231, 199854, 716014, 2584742, 9390656, 34315811, 126039218, 465062362, 1723066193, 6407806833, 23910159818, 89493721076, 335912335304, 1264105728831, 4768446686910, 18027215660947, 68291877609003
Offset: 0

Views

Author

Tilman Piesk, Aug 07 2025

Keywords

Comments

A022553(n) is the number of primitive 2n-bead balanced binary necklaces (corresponding to Lyndon words), and A000048 is the number of those that are self-complementary (i.e., can be rotated so that all beads change color). Their difference 2*a(n) is the number of those that are not self-complementary. a(n) is the number pairs of distinct complements.
Doubled entries: 0, 0, 0, 2, 6, 22, 70, 236, 784, 2672, 9174, 31972, 112462, 399708, 1432028, ...
Sequences counting 2n-bead balanced binary necklaces:
primitive imprimitive
+-----------------------+---------+
self-complementary | A000048 A115118 | A000013 |
complement pairs | this A387130 | A386388 |
+-----------------------+---------+
+-----------------------+---------+

Examples

			  n | A022553(n) A000048(n) | 2*a(n)    a(n)
  0 |         1          1  |     0       0
  1 |         1          1  |     0       0
  2 |         1          1  |     0       0
  3 |         3          1  |     2       1
  4 |         8          2  |     6       3
  5 |        25          3  |    22      11
  6 |        75          5  |    70      35
  7 |       245          9  |   236     118
  8 |       800         16  |   784     392
  9 |      2700         28  |  2672    1336
 10 |      9225         51  |  9174    4587
Examples for n=5 with necklaces of length 10:
The total number of necklaces is A003239(5) = 26.
Only A386946(5) = 1 of them is periodic, namely 0101010101.
The other A022553(5) = 25 are primitive.
A000048(5) = 3 among those are self-complementary:
 0000011111
 0001011101
 0010011011
The remaining 22 necklaces form a(5) = 11 complement pairs:
 0000101111 0000111101
 0000110111 0001111001
 0000111011 0001001111
 0001010111 0001110101
 0001011011 0010011101
 0001100111 0001110011
 0001101011 0010100111
 0001101101 0010010111
 0010101011 0011010101
 0010101101 0010110101
 0010110011 0011001101
		

Formula

a(n) = (A022553(n) - A000048(n)) / 2.

A385476 Values of u in the quartets (1, u, v, w) of type 3; i.e., values of u for solutions to (1 - u) = v(v - w), in distinct positive integers, with v > 1, sorted by nondecreasing values of u; see Comments.

Original entry on oeis.org

5, 7, 7, 9, 9, 10, 11, 11, 13, 13, 13, 13, 15, 15, 16, 16, 17, 17, 17, 19, 19, 19, 19, 21, 21, 21, 21, 22, 22, 23, 23, 25, 25, 25, 25, 25, 25, 26, 27, 27, 28, 28, 29, 29, 29, 29, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 37, 37
Offset: 1

Views

Author

Clark Kimberling, Aug 16 2025

Keywords

Comments

A 4-tuple (m, u, v, w) is a quartet of type 3 if m, u, v, w are distinct positive integers such that m < v and m*(m - u) = v*(v - w). Here, the values of u are arranged in nondecreasing order. When there is more than one solution for given m and u, the values of v are arranged in increasing order. Here, m = 1.

Examples

			First 20 quartets (1,u,v,w) of type 3:
   m    u    v    w
   1    5    2    4
   1    7    2    5
   1    7    3    5
   1    9    2    6
   1    9    4    6
   1   10    3    6
   1   11    2    7
   1   11    5    7
   1   13    2    8
   1   13    3    7
   1   13    4    7
   1   13    6    8
   1   15    2    9
   1   15    7    9
   1   16    3    5
   1   16    3    8
   1   17    2   10
   1   17    4    8
   1   17    8   10
   1   19    2   11
1(1-11) = 5(5-7), so (1, 11, 5, 7) is in the list.
		

Crossrefs

Cf. A385182 (type 1), A386218 (type 2), A386631, A385246.

Programs

  • Mathematica
    solnsM[m_Integer?Positive, u_Integer?Positive] :=
      Module[{n = m  (m - u), nn, sgn, ds, tups}, If[n == 0, Return[{}]];
       sgn = Sign[n]; nn = Abs[n];
       ds = Divisors[nn];
       If[sgn > 0, ds = Select[ds, # < nn/# &]];
       tups = ({m, u, nn/#, nn/# - sgn  #} & /@ ds);
       Select[tups, #[[3]] > 1 && #[[4]] > 0 && #[[2]] =!= #[[4]](*&&
         Length@DeleteDuplicates[#]==4*)&]];
    (solns =
       Sort[Flatten[Map[solnsM[1, #] &, Range[2, 30]], 1]]) // ColumnForm
    Map[#[[2]] &, solns] (*A385476*)
    Map[#[[3]] &, solns] (*A163870*)
    Map[#[[4]] &, solns] (*A385246*)
    (* Peter J. C. Moses, Aug 22 2025 *)

A385852 Integers x such that there exist two integers 0

Original entry on oeis.org

79170, 150150, 158340, 161070, 232050, 237510, 300300, 316680, 322140, 395850, 450450, 464100, 468930, 474810, 475020, 483210, 554190, 570570, 600600, 622440, 633360, 641550, 644280, 696150, 712530, 750750, 791700, 805350, 937860, 949620, 950040, 963270, 966420
Offset: 1

Views

Author

S. I. Dimitrov, Aug 07 2025

Keywords

Comments

The numbers x, y and z form a psi-amicable triple according to Dimitrov's definition.

Examples

			79170 is in the sequence since psi(79170) = psi(80850) = psi(81900) = 241920 = 79170 + 80850 + 81900. Other examples: (161070, 161070, 161700), (7063980, 7112490, 7112490).
		

Crossrefs

A386307 Ordered hypotenuses of Pythagorean triples that do not have the form (u^2 - v^2, 2*u*v, u^2 + v^2), where u and v are positive integers.

Original entry on oeis.org

15, 25, 30, 35, 39, 50, 51, 55, 60, 65, 65, 70, 75, 75, 78, 85, 85, 87, 91, 95, 100, 102, 105, 110, 111, 115, 119, 120, 123, 125, 130, 130, 135, 140, 143, 145, 145, 150, 150, 155, 156, 159, 165, 169, 170, 170, 174, 175, 175, 182, 183, 185, 185, 187, 190, 195, 195
Offset: 1

Views

Author

Felix Huber, Aug 13 2025

Keywords

Comments

In the form (u^2 - v^2, 2*u*v, u^2 + v^2), u^2 + v^2) is the hypotenuse, max(u^2 - v^2, 2*u*v) is the long leg and min(u^2 - v^2, 2*u*v) is the short leg.
A101930(n) gives the total number of Pythagorean triples <= 10^n. The percentage of triangles in this sequence increases continuously:
number of terms <= h total number of
h in this sequence hypotenuses <= h percentage
10 0 2 0.0 %
100 21 52 40.4 %
1000 514 881 58.3 %
10000 8629 12471 69.2 %
100000 122431 161436 75.8 %

Examples

			The Pythagorean triple (9, 12, 15) does not have the form (u^2 - v^2, 2*u*v, u^2 + v^2), because 15 is not a sum of two nonzero squares. Therefore 15 is a term.
		

Crossrefs

Programs

  • Maple
    A386307:=proc(N) # To get all hypotenuses <= N
        local i,l,m,u,v,r,x,y,z;
        l:={};
        m:={};
        for u from 2 to floor(sqrt(N-1)) do
            for v to min(u-1,floor(sqrt(N-u^2))) do
                x:=min(2*u*v,u^2-v^2);
                y:=max(2*u*v,u^2-v^2);
                z:=u^2+v^2;
                m:=m union {[z,y,x]};
                if gcd(u,v)=1 and is(u-v,odd) then
                    l:=l union {seq([i*z,i*y,i*x],i=1..N/z)}
                fi
            od
        od;
        r:=l minus m;
        return seq(r[i,1],i=1..nops(r));
    end proc;
    A386307(1000);

Formula

a(n) = sqrt(A386308(n)^2 + A386309(n)^2).
{A009000(n)} = {a(n)} union {A020882(n)} union {A386943(n)}.
Previous Showing 51-60 of 422 results. Next