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 81-90 of 384 results. Next

A360413 Irregular table T(n, k), n >= 0, k = 1..A002487(n+1), read by rows; the n-th row lists the numbers k such that A065361(k) = n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 9, 7, 10, 8, 11, 12, 13, 14, 15, 18, 27, 16, 19, 28, 17, 20, 21, 29, 30, 22, 31, 23, 24, 32, 33, 36, 25, 34, 37, 26, 35, 38, 39, 40, 41, 42, 45, 54, 81, 43, 46, 55, 82, 44, 47, 48, 56, 57, 83, 84, 49, 58, 85, 50, 51, 59, 60, 63, 86, 87, 90
Offset: 0

Views

Author

Rémy Sigrist, Feb 06 2023

Keywords

Comments

As a flat sequence, this is a permutation of the nonnegative integers with inverse A360414.

Examples

			Table T(n, k) begins:
  n   n-th row
  --  ------------------
   0  0
   1  1
   2  2, 3
   3  4
   4  5, 6, 9
   5  7, 10
   6  8, 11, 12
   7  13
   8  14, 15, 18, 27
   9  16, 19, 28
  10  17, 20, 21, 29, 30
  11  22, 31
  12  23, 24, 32, 33, 36
.
Table T(n, k) begins (with terms given in base 3):
  n   n-th row in base 3
  --  -------------------------
   0  0
   1  1
   2  2, 10
   3  11
   4  12, 20, 100
   5  21, 101
   6  22, 102, 110
   7  111
   8  112, 120, 200, 1000
   9  121, 201, 1001
  10  122, 202, 210, 1002, 1010
  11  211, 1011
  12  212, 220, 1012, 1020, 1100
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

T(n, 1) = A032924(n) for any n > 0.
T(n, A002487(n+1)) = A005836(n+1).
A065361(T(n, k)) = n.

A376242 a(n) = least m >= 0 such that (x = f(A376241(n)), y = f(m), z = (x+y)/(xy-1)) yields an integer x+y+z = x*y*z, where f(m) = A002487(m)/A002487(m+1).

Original entry on oeis.org

0, 1, 2, 1, 6, 2, 2, 14, 4, 30, 12, 35, 2, 4, 9, 20, 4, 8, 126, 56, 32, 152, 52, 254, 61, 84, 40, 16, 4, 510, 368, 320, 212, 48, 396, 72, 583, 1022, 792, 368, 98, 188, 340, 80, 583, 339, 140, 32, 233, 2046, 480, 384, 583, 2062, 852, 188, 328
Offset: 1

Views

Author

M. F. Hasler, Sep 16 2024

Keywords

Comments

A376241 uses the Stern-Brocot sequence s = A002487 to enumerate all (nonnegative) rational x = s(n)/s(n+1) and similarly y = s(m)/s(m+1), WLOG m <= n, which yield an integer x*y*z = x+y+z with (necessarily) z = (x+y)/(xy-1). The present sequence lists the m-values corresponding to the n-values listed in A376241.

Examples

			The terms correspond to the following solutions, with y = A002487(m)/A002487(m+1):
   m |  x  |  y  |  z  | xyz = x+y+z
-----+-----+-----+-----+------------
   0 |  0  |  0  |  0  |   0
   1 |  2  |  1  |  3  |   6
   2 | 3/2 | 1/2 | -8  |  -6
   1 |  3  |  1  |  2  |   6
   6 | 4/3 | 2/3 | -18 |  -16
   2 | 5/2 | 1/2 |  12 |   15
   2 |  4  | 1/2 | 9/2 |   9
  14 | 5/4 | 3/4 | -32 |  -30
  ...| ... | ... | ... |  ...
		

Crossrefs

Cf. A002487 (Stern-Brocot sequence), A376241 (corresponding n values), A376243 (set of absolute values of corresponding xyz = x+y+z).

Programs

  • PARI
    A376242(n, k=A376241(n))={my(p, q=1, x=A002487(k)/A002487(k+1)); for(m=2, k, my(y=(p=q)/q=A002487(m)); x*y != 1 && denominator(x+y+(x+y)/(x*y-1))==1 && return(m-1))} \\ Short of a function A376241(n), one can simply provide a term k = A376241(n) as second argument and omit the first argument n.

A071016 Stirling_2 transform of A002487.

Original entry on oeis.org

1, 3, 8, 24, 88, 381, 1822, 9254, 49295, 275219, 1614968, 9993871, 65442602, 454736731, 3356546167, 26272011685, 217027548533, 1879608087006, 16946483469822, 158067735588494, 1518042086052977, 14962182709519890, 151056371629601794, 1560637060858070869
Offset: 1

Views

Author

N. J. A. Sloane, May 24 2002

Keywords

A071412 A002487 mod 3.

Original entry on oeis.org

0, 1, 1, 2, 1, 0, 2, 0, 1, 1, 0, 2, 2, 2, 0, 1, 1, 2, 1, 1, 0, 2, 2, 1, 2, 1, 2, 2, 0, 1, 1, 2, 1, 0, 2, 0, 1, 2, 1, 1, 0, 2, 2, 1, 2, 0, 1, 0, 2, 0, 1, 0, 2, 1, 2, 2, 0, 1, 1, 2, 1, 0, 2, 0, 1, 1, 0, 2, 2, 2, 0, 1, 1, 0, 2, 0, 1, 2, 1, 1, 0, 2, 2, 1, 2, 0, 1, 0, 2, 2, 0, 1, 1, 1, 0, 2, 2, 2, 0, 1, 1, 1, 0, 2, 2
Offset: 0

Views

Author

N. J. A. Sloane, Jul 15 2002

Keywords

References

  • E. Dijkstra, Selected Writings on Computing, Springer, 1982, p. 232 (sequence is called fusc).

Programs

  • Python
    from functools import reduce
    def A071412(n): return sum(reduce(lambda x,y:(x[0],(x[0]+x[1])%3) if int(y) else ((x[0]+x[1])%3,x[1]),bin(n)[-1:2:-1],(1,0)))%3 if n else 0 # Chai Wah Wu, May 18 2023

A071883 A002487(n)*A002487(n+2).

Original entry on oeis.org

0, 2, 1, 6, 2, 9, 2, 12, 3, 20, 6, 25, 6, 20, 3, 20, 4, 35, 12, 56, 15, 56, 10, 49, 10, 56, 15, 56, 12, 35, 4, 30, 5, 54, 20, 99, 28, 110, 21, 110, 24, 143, 40, 156, 35, 108, 14, 81, 14, 108, 35, 156, 40, 143, 24, 110, 21, 110, 28, 99, 20
Offset: 0

Views

Author

N. J. A. Sloane, Jun 10 2002

Keywords

Crossrefs

A071898 CONTINUANT transform of A002487: 1, 1, 2, 1, 3, 2, ...

Original entry on oeis.org

1, 2, 5, 7, 26, 59, 203, 262, 1251, 4015, 21326, 46667, 254661, 810650, 3497261, 4307911, 25036816, 104455175, 756223041, 2373124298, 19741217425, 101079211423, 727295697386, 1555670606195, 11616989940751, 59640620309950, 488741952420351, 1525866477571003
Offset: 1

Views

Author

N. J. A. Sloane, Jun 10 2002

Keywords

Crossrefs

Cf. A002487.

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<2, n,
          `if`(irem(n, 2, 'r')=0, b(r), b(r) + b(r+1)))
        end:
    a:= proc(n) option remember; `if`(n<0, 0,
          `if`(n=0, 1, b(n)*a(n-1)+a(n-2)))
        end:
    seq(a(n), n=1..35);  # Alois P. Heinz, Aug 06 2013
  • Mathematica
    b[n_] := b[n] = If[n < 2, n, r = Quotient[n, 2]; If[Mod[n, 2] == 0, b[r], b[r] + b[r + 1]]];
    a[n_] := a[n] = If[n < 0, 0, If[n == 0, 1, b[n] a[n - 1] + a[n - 2]]];
    Array[a, 35] (* Jean-François Alcover, Nov 10 2020, after Alois P. Heinz *)

A071970 List the positive rationals in the order in which they are produced by the Stern sequence A002487 and apply the Sagher map to turn them into integers.

Original entry on oeis.org

1, 2, 4, 3, 18, 12, 9, 8, 48, 45, 50, 20, 75, 72, 16, 5, 200, 112, 147, 288, 320, 175, 98, 28, 245, 800, 192, 63, 392, 80, 25, 6, 180, 675, 648, 176, 847, 490, 300, 99, 3872, 832, 845, 600, 1008, 1323, 162, 108, 567, 1176, 720, 325, 5408, 704, 363, 90, 700, 539
Offset: 1

Views

Author

N. J. A. Sloane, Jun 19 2002

Keywords

Comments

The Sagher map sends Product p_i^e_i / Product q_i^f_i (p_i and q_i being distinct primes) to Product p_i^(2e_i) * Product q_i^(2f_i-1). This is multiplicative.

Examples

			The first few rationals and their images are 1/1 -> 1, 1/2 -> 2, 2/1 -> 4, 1/3 -> 3, 3/2 -> 18, 2/3 -> 12, 3/1 -> 9, 1/4 -> 8, ...
		

Crossrefs

Programs

  • Mathematica
    nmax = 58; s[0] = 0; s[1] = 1; s[n_?EvenQ] := s[n/2]; s[n_] := s[(n-1)/2] + s[(n+1)/2]; v = Table[ FactorInteger /@ {s[n] , s[n+1]}, {n, 1, nmax}]; a[n_] := Times @@ (#[[1]]^(2*#[[2]])&) /@ v[[n, 1]]*Times @@ (#[[1]]^(2*#[[2]]-1)&) /@ v[[n, 2]]; Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, Nov 25 2011, after Pari *)
  • PARI
    s(n)=if(n<2,n>0,if(n%2,s((n+1)/2)+s((n-1)/2),s(n/2))) /* A002487(n) */
    
  • PARI
    a(n)=local(v); if(n,v=factor(s(n)/s(n+1))~; prod(k=1,length(v),v[1,k]^if(v[2,k]<0,-1-2*v[2,k],2*v[2,k])),0)

Extensions

More terms from Michael Somos, Jul 19 2002

A127971 a(n) = fusc(n+1) + (1-(-1)^n)/2, fusc = A002487.

Original entry on oeis.org

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

Views

Author

Paul Barry, Feb 09 2007

Keywords

Comments

Row sums of A127970.

Programs

  • Magma
    [(1-(-1)^n)/2 + (&+[Binomial(n-k,k) mod 2: k in [0..Floor(n/2)]]) : n in [0..50]]; // G. C. Greubel, May 04 2018
    
  • Mathematica
    Table[Sum[Mod[Binomial[n-k,k],2], {k, 0, Floor[n/2]}] + (1-(-1)^n)/2, {n, 0, 50}] (* G. C. Greubel, May 04 2018 *)
  • PARI
    for(n=0, 50, print1((1-(-1)^n)/2 + sum(k=0,floor(n/2), lift(Mod( binomial(n-k,k), 2))), ", ")) \\ G. C. Greubel, May 04 2018
    
  • Python
    from functools import reduce
    def A127971(n): return sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(n+1)[-1:2:-1],(1,0)))+(n&1) # Chai Wah Wu, May 18 2023

Formula

a(n) = (1-(-1)^n)/2 + Sum_{k=0..floor(n/2)} mod(C(n-k,k),2).

A240388 A sequence related to the Stern sequence s(n) (A002487), defined by w(n) = s(3n)/2.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 2, 4, 1, 4, 2, 3, 2, 5, 4, 6, 1, 6, 4, 5, 2, 3, 3, 7, 2, 9, 5, 7, 4, 9, 6, 8, 1, 8, 6, 9, 4, 7, 5, 9, 2, 7, 3, 4, 3, 8, 7, 11, 2, 13, 9, 12, 5, 8, 7, 15, 4, 17, 9, 11, 6, 13, 8, 10, 1, 10, 8, 13, 6, 11, 9, 17, 4, 15, 7, 8, 5, 12, 9, 13, 2, 11, 7, 8, 3, 4, 4, 10, 3, 14, 8, 12, 7, 16, 11, 15, 2, 17, 13, 20, 9, 16, 12, 22, 5, 18, 8, 10, 7, 18, 15, 23, 4, 25, 17, 22, 9, 14, 11, 23, 6, 25, 13, 15, 8, 17, 10, 12, 1
Offset: 0

Views

Author

Jennifer Lansing, Apr 04 2014

Keywords

Comments

The even terms in the Stern sequence, divided by 2.

Examples

			w(7) = w(8-1) = w(3)+2w(1) = 2+2 = 4.
w(11) = w(8+3) = w(4+1)+w(2+1)-w(1)=w(5)+w(3)-w(1) = 2+2-1 = 3.
Comment from _N. J. A. Sloane_, Jul 01 2014: (Start)
May be arranged as a triangle:
  0
  1
  1
  2 1 2
  2 4 1 4 2
  3 2 5 4 6 1 6 4 5 2 3
  3 7 2 9 5 7 4 9 6 8 1 8 6 9 4 7 5 9 2 7 3
  ... (End)
		

Crossrefs

Cf. A002487.

Programs

  • Maple
    A240388 := proc(n)
        option remember;
        local nloc;
        if n <=1  then
            n;
        elif n = 3 then
            2;
        elif type(n,'even') then
            procname(n/2) ;
        elif modp(n,8) = 1 then
            nloc := (n-1)/8 ;
            procname(4*nloc+1)+2*procname(nloc) ;
        elif modp(n,8) = 7 then
            nloc := (n+1)/8 ;
            procname(4*nloc-1)+2*procname(nloc) ;
        elif modp(n,8) = 3 then
            nloc := (n-3)/8 ;
            procname(4*nloc+1)+procname(2*nloc+1)-procname(nloc) ;
        else
            nloc := (n+3)/8 ;
            procname(4*nloc-1)+procname(2*nloc-1)-procname(nloc) ;
        end if;
    end proc: # R. J. Mathar, Jul 05 2014
    # second Maple program:
    b:= proc(n) option remember; `if`(n<2, n,
          (q-> b(q)+(n-2*q)*b(n-q))(iquo(n, 2)))
        end:
    a:= n-> b(3*n)/2:
    seq(a(n), n=0..128);  # Alois P. Heinz, Jun 20 2022
  • Mathematica
    Clear[s]; s[0] = 0; s[1] = 1; s[n_?EvenQ] := s[n] = s[n/2];
    s[n_?OddQ] :=
    s[n] = s[(n + 1)/2] + s[(n - 1)/2] (* For the Stern sequence *)
    Clear[w]; w[n_] = 1/2 s[3 n]
  • PARI
    a(n)=my(a=1, b=0); n*=3; while(n>0, if(n%2, b+=a, a+=b); n>>=1); b/2 \\ Charles R Greathouse IV, May 27 2014
    
  • Python
    from functools import reduce
    def A240388(n): return sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(3*n)[-1:2:-1],(1,0)))//2 # Chai Wah Wu, Jun 20 2022

Formula

w(0)=0, w(1)=1, and w(3)=2. For n >= 1, w(n) satisfies the recurrences w(2n)=w(n), w(8n +/- 1)=w(4n +/- 1) + 2w(n), w(8n +/- 3)=w(4n +/- 1) + w(2n +/- 1) -w(n).
a(n) = A002487(3*n) / 2. - Joerg Arndt, Jun 20 2022

A293957 When A002487 is written as a triangle the n-th row has length 2^(n-1); a(n) is the maximal multiplicity of any entry in that row, considering the entries strictly between the initial 1 and the central 2.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 2, 4, 5, 6, 8, 12, 16, 22, 29, 36, 48, 67, 84, 118, 151, 203, 270, 362, 472, 636, 846, 1142, 1526, 2024, 2736, 3666, 4918, 6550, 8776, 11796, 15824
Offset: 0

Views

Author

N. J. A. Sloane, Nov 03 2017

Keywords

Comments

The maximal entry is row n is Fibonacci(n+1), and the smallest missing number is A135510(n). The number of distinct numbers in each row is given by A293160.
It would be nice to have a formula for this sequence, or at least some bounds.

Examples

			Rows 0 through 6 of A002487 are:
0,
1,
1, 2,
1, 3, 2, 3,
1, 4, 3, 5, 2, 5, 3, 4,
1, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5,
1, 6, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 2, 9, 7, 12, 5, 13, 8, 11, 3, 10, 7, 11, 4, 9, 5, 6,
To find a(5) we consider the entries 1, 5, 4, 7, 3, 8, 5, 7, 2 in row 5. Ignoring the initial 1 and the final 2, the maximal multiplicity is 2 (for example, 5 appears twice), so a(5) = 2.
From _Don Reble_, Nov 04 2017: (Start)
The initial values of a(n) for n >= 3 together with the terms that have the highest multiplicity are:
3    1 [3]
4    1 [3 4 5]
5    2 [5 7]
6    2 [5 7 9 11]
7    4 [11]
8    5 [13 17]
9    6 [19 23 31 41]
10    8 [23 37 43]
11   12 [71]
12   16 [71]
13   22 [127]
14   29 [109]
15   36 [199 251]
16   48 [263]
17   67 [433]
18   84 [701]
19  118 [839]
20  151 [1193]
21  203 [1801]
22  270 [2693]
23  362 [4229]
24  472 [4349]
25  636 [7759]
26  846 [11287]
27 1142 [14627]
28 1526 [20929]
29 2024 [37243]
30 2736 [43133]
31 3666 [67231]
32 4918 [90227]
33 6550 [127819]
34 8776 [181031]
35 11796 [251071]
36 15824 [394549]
(End)
		

Crossrefs

Programs

  • Maple
    A002487 := proc(n) option remember; if n <= 1 then n elif n mod 2 = 0 then procname(n/2); else procname((n-1)/2)+procname((n+1)/2); fi; end:
    ans:=[];
    for n from 3 to 18 do
    b1:=2^(n-1); b2:=2^n-1; b3:=2^(n-2)-1; mx:=0;
    ar:=Array(0..b1-1,0);
    for k from 1 to b3 do
    kk:=b1+k;
    v:=A002487(kk);
    ar[v]:=ar[v]+1;
    od:
       for k from 0 to b1-1 do if ar[k]>mx then mx:=ar[k]; fi; od:
    ans:=[op(ans),mx];
    od:
    ans;
  • Python
    from itertools import chain, product
    from collections import Counter
    from functools import reduce
    def A293957(n): return 0 if n <= 2 else max(Counter(m for m in (sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if y else (x[0]+x[1],x[1]),chain(k,(1,)),(1,0))) for k in product((False,True),repeat=n-2)) if m != 1 and m != 2).values()) # Chai Wah Wu, Jun 20 2022

Extensions

a(19)-a(36) from Don Reble, Nov 04 2017
Previous Showing 81-90 of 384 results. Next