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 21-30 of 46 results. Next

A327539 Starting from n: as long as the decimal representation starts with a positive even number, divide the largest such prefix by 2; a(n) corresponds to the final value.

Original entry on oeis.org

0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1, 17, 9, 19, 5, 11, 11, 13, 3, 15, 13, 17, 7, 19, 15, 31, 1, 33, 17, 35, 9, 37, 19, 39, 5, 11, 11, 13, 11, 15, 13, 17, 3, 19, 15, 51, 13, 53, 17, 55, 7, 57, 19, 59, 15, 31, 31, 33, 1, 35, 33, 37, 17, 39, 35, 71
Offset: 0

Views

Author

Rémy Sigrist, Nov 29 2019

Keywords

Comments

For n > 0, as long as we have a number whose decimal representation is the concatenation of a positive even number, say u, and a possibly empty string of odd digits, say v, we replace this number with the concatenation of u/2 and v; eventually only odd digits remain.

Examples

			For n = 10000:
- 10000 gives 10000/2 = 5000,
- 5000 gives 5000/2 = 2500,
- 2500 gives 2500/2 = 1250,
- 1250 gives 125/2 = 625,
- 625 gives 62/2 followed by 5 = 315,
- 315 has only odd digits, so a(10000) = 315.
		

Crossrefs

See A329249, A329424 and A329428 for similar sequences.

Programs

Formula

a(n) <= n with equality iff n = 0 or n belongs to A014261.
a(2*n) = a(n).
a(10*k + v) = 10*a(k) + v for any k >= 0 and v in {1, 3, 5, 7, 9}.
a(n) = 1 iff n is a power of 2.
a(n) = 3 iff n belongs to A007283.
a(n) = 5 iff n belongs to A020714.
a(n) = 7 iff n belongs to A005009.
a(n) = 9 iff n belongs to A005010.
a(n) = a(n+1) iff n belongs to A215145.

A029748 Numbers of the form 2^k times 1, 3 or 7.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 12, 14, 16, 24, 28, 32, 48, 56, 64, 96, 112, 128, 192, 224, 256, 384, 448, 512, 768, 896, 1024, 1536, 1792, 2048, 3072, 3584, 4096, 6144, 7168, 8192, 12288, 14336, 16384, 24576, 28672, 32768, 49152, 57344, 65536, 98304, 114688, 131072
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[-(x^5 + 2 x^4 + 2 x^3 + 3 x^2 + 2 x + 1)/(2 x^3 - 1), {x, 0, 50}], x] (* Vincenzo Librandi, Oct 18 2013 *)
    Sort[Flatten[#{1,3,7}&/@(2^Range[0,20])]] (* Harvey P. Dale, Jan 30 2014 *)

Formula

From Colin Barker, Jul 19 2013: (Start)
a(n) = 2*a(n-3) for n>5.
G.f.: -(x^5+2*x^4+2*x^3+3*x^2+2*x+1) / (2*x^3-1). (End)
Sum_{n>=0} 1/a(n) = 62/21. - Amiram Eldar, Jan 17 2022

Extensions

More terms from Colin Barker, Jul 19 2013

A047335 Numbers that are congruent to {0, 6} mod 7.

Original entry on oeis.org

0, 6, 7, 13, 14, 20, 21, 27, 28, 34, 35, 41, 42, 48, 49, 55, 56, 62, 63, 69, 70, 76, 77, 83, 84, 90, 91, 97, 98, 104, 105, 111, 112, 118, 119, 125, 126, 132, 133, 139, 140, 146, 147, 153, 154, 160, 161, 167, 168
Offset: 1

Views

Author

Keywords

References

  • Hsien-Kuei Hwang, S Janson, TH Tsai, Exact and asymptotic solutions of the recurrence f(n) = f(floor(n/2)) + f(ceiling(n/2)) + g(n): theory and applications, Preprint, 2016; http://140.109.74.92/hk/wp-content/files/2016/12/aat-hhrr-1.pdf. Also Exact and Asymptotic Solutions of a Divide-and-Conquer Recurrence Dividing at Half: Theory and Applications, ACM Transactions on Algorithms, 13:4 (2017), #47; DOI: 10.1145/3127585

Crossrefs

Cf. A274406.

Programs

  • Mathematica
    Select[Range[0,200],MemberQ[{0,6},Mod[#,7]]&]  (* Harvey P. Dale, Mar 16 2011 *)

Formula

From Bruno Berselli, Oct 06 2010: (Start)
G.f.: x^2*(6+x)/((1+x)*(1-x)^2).
a(n) - a(n-1) - a(n-2) + a(n-3) = 0 (n > 3).
a(n) = (14*n + 5*(-1)^n - 9)/4.
a(n) - a(n-2) = 7 (n > 2).
a(n) - a(n-1) = A010687(k) with n > 1 and k == n-1 (mod 2). (End)
a(n+1) = Sum_{k>=0} A030308(n,k)*b(k) with b(0)=6 and b(k) = 7*2^(k-1) = A005009(k-1) for k > 0. - Philippe Deléham, Oct 18 2011

A047382 Numbers that are congruent to {0, 5} mod 7.

Original entry on oeis.org

0, 5, 7, 12, 14, 19, 21, 26, 28, 33, 35, 40, 42, 47, 49, 54, 56, 61, 63, 68, 70, 75, 77, 82, 84, 89, 91, 96, 98, 103, 105, 110, 112, 117, 119, 124, 126, 131, 133, 138, 140, 145, 147, 152, 154, 159, 161, 166, 168
Offset: 1

Views

Author

Keywords

Comments

Except for the first term, numbers m such that 36*m^2 + 72*m + 35 = (6*m+5)*(6*m+7) is not of the form p*(p+2), with p prime. - Vincenzo Librandi, Aug 05 2010
Nonnegative k such that k or 4*k + 1 is divisible by 7. - Bruno Berselli, Feb 13 2018

Crossrefs

Programs

  • Magma
    &cat[[7*n,7*n+5]: n in [0..23]];  // Bruno Berselli, Oct 17 2011
    
  • Mathematica
    {#, 5 + #} &/@ (7 Range[0, 30]) // Flatten (* or *) LinearRecurrence[{1, 1, -1}, {0, 5, 7}, 60] (* Harvey P. Dale, Dec 01 2016 *)
  • PARI
    a(n) = (14*n + 3*(-1)^n - 11)/4 \\ David Lovler, Sep 11 2022

Formula

a(n) = 7*n - a(n-1) - 9 for n>1, with a(1)=0. - Vincenzo Librandi, Aug 05 2010
a(n+1) = Sum_{k>=0} A030308(n,k)*b(k) with b(0)=5 and b(k)=A005009(k-1)=7*2^(k-1) for k>0. - Philippe Deléham, Oct 17 2011
From Bruno Berselli, Oct 17 2011: (Start)
G.f.: x^2*(5 + 2*x)/((1 + x)*(1 - x)^2).
a(n) = (14*n + 3*(-1)^n - 11)/4.
a(-n) = -A047352(n+2). (End)
a(n) = ceiling((7/3)*ceiling(3*n/2)). - Clark Kimberling, Jul 04 2012
E.g.f.: 2 + ((14*x - 11)*exp(x) + 3*exp(-x))/4. - David Lovler, Sep 11 2022

A125176 Row sums of A125175.

Original entry on oeis.org

1, 3, 7, 14, 28, 56, 112, 224, 448, 896, 1792, 3584, 7168, 14336, 28672, 57344, 114688, 229376, 458752, 917504, 1835008, 3670016, 7340032, 14680064, 29360128, 58720256, 117440512, 234881024, 469762048, 939524096, 1879048192, 3758096384, 7516192768, 15032385536
Offset: 1

Views

Author

Gary W. Adamson, Nov 22 2006

Keywords

Examples

			First few rows of A125175 are:
  1;
  1, 2;
  1, 3, 3;
  1, 4, 5, 4;
  ....
a(4) = 1 + 4 + 5 + 4 = 14.
a(6) = 1 + 6 + 14 + 20 + 9 + 6 = 56 = 7*8 = 7*2^3.
		

Crossrefs

Cf. A125175.
Essentially identical to A005009.

Programs

  • GAP
    Concatenation([1,3], List([3..40], n-> 7*2^(n-3))); # G. C. Greubel, Jun 05 2019
    
  • Magma
    [1,3] cat [7*2^(n-3): n in [3..40]];  // G. C. Greubel, Jun 05 2019
    
  • Mathematica
    Rest@CoefficientList[Series[x*(1+x+x^2)/(1-2*x), {x, 0, 40}], x] (* Vincenzo Librandi, Oct 12 2013 *)
  • PARI
    concat([1,3], vector(30, n, 7*2^(n-1))) \\ G. C. Greubel, Jun 05 2019
    
  • Python
    print([7*2**n//8 for n in range(1, 50)]) # Karl V. Keller, Jr., May 11 2022
  • Sage
    [1,3]+[7*2^(n-3) for n in (3..40)] # G. C. Greubel, Jun 05 2019
    

Formula

a(1) = 1, a(2) = 3, a(n) = 7*2^(n-3) for n>=3.
From Colin Barker, Oct 12 2013: (Start)
a(n) = 2*a(n-1) for n>3.
G.f.: x*(1 + x + x^2)/(1-2*x). (End)
E.g.f.: (7*exp(2*x) - 7 - 6*x - 2*x^2)/8. - G. C. Greubel, Jun 05 2019

Extensions

More terms from N. J. A. Sloane, Dec 15 2007

A135092 Binomial transform of [1, 6, 1, 6, 1, 6, ...].

Original entry on oeis.org

1, 7, 14, 28, 56, 112, 224, 448, 896, 1792, 3584, 7168, 14336, 28672, 57344, 114688, 229376, 458752, 917504, 1835008, 3670016, 7340032, 14680064, 29360128, 58720256, 117440512, 234881024, 469762048, 939524096, 1879048192, 3758096384, 7516192768, 15032385536
Offset: 0

Views

Author

Gary W. Adamson, Nov 18 2007

Keywords

Examples

			a(3) = (1, 3, 3, 1) dot (1, 6, 1, 6) = (1 + 18 + 3 + 6) = 28 = 7*2^2.
		

Crossrefs

Essentially identical to A005009 and to A125176.

Programs

  • Mathematica
    Join[{1},NestList[2#&,7,50]] (* Harvey P. Dale, Aug 30 2015 *)

Formula

a(n) = 7*2^(n-1) for n>0, a(0)=1.
a(n) = Sum_{k=0..n} A097805(n,k)*7^k*(-5)^(n-k). - Philippe Deléham, Nov 19 2007
G.f.: (1+5*x)/(1-2*x). - Bruno Berselli, Sep 20 2011
E.g.f.: (1/2)*(7*exp(2*x) - 5). - G. C. Greubel, Sep 22 2016
a(n) = A125176(n+2) for n >= 1. - Georg Fischer, Nov 02 2018

Extensions

Corrected and extended by Philippe Deléham and N. J. A. Sloane, Dec 15 2007

A340666 A(n,k) is derived from n by replacing each 0 in its binary representation with a string of k 0's; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 0, 1, 2, 3, 0, 1, 4, 3, 1, 0, 1, 8, 3, 4, 3, 0, 1, 16, 3, 16, 5, 3, 0, 1, 32, 3, 64, 9, 6, 7, 0, 1, 64, 3, 256, 17, 12, 7, 1, 0, 1, 128, 3, 1024, 33, 24, 7, 8, 3, 0, 1, 256, 3, 4096, 65, 48, 7, 64, 9, 3, 0, 1, 512, 3, 16384, 129, 96, 7, 512, 33, 10, 7
Offset: 0

Views

Author

Alois P. Heinz, Jan 15 2021

Keywords

Examples

			Square array A(n,k) begins:
  0, 0,  0,   0,    0,     0,      0,       0,        0, ...
  1, 1,  1,   1,    1,     1,      1,       1,        1, ...
  1, 2,  4,   8,   16,    32,     64,     128,      256, ...
  3, 3,  3,   3,    3,     3,      3,       3,        3, ...
  1, 4, 16,  64,  256,  1024,   4096,   16384,    65536, ...
  3, 5,  9,  17,   33,    65,    129,     257,      513, ...
  3, 6, 12,  24,   48,    96,    192,     384,      768, ...
  7, 7,  7,   7,    7,     7,      7,       7,        7, ...
  1, 8, 64, 512, 4096, 32768, 262144, 2097152, 16777216, ...
  ...
		

Crossrefs

Columns k=0-2, 4 give: A038573, A001477, A084471, A084473.
Rows n=0..17, 19 give: A000004, A000012, A000079, A010701, A000302, A000051(k+1), A007283, A010727, A001018, A087289, A007582(k+1), A062709(k+2), A164346, A181565(k+1), A005009, A181404(k+3), A001025, A199493, A253208(k+1).
Main diagonal gives A340667.

Programs

  • Maple
    A:= (n, k)-> Bits[Join](subs(0=[0$k][], Bits[Split](n))):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
    # second Maple program:
    A:= proc(n, k) option remember; `if`(n<2, n,
         `if`(irem(n, 2, 'r')=1, A(r, k)*2+1, A(r, k)*2^k))
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    A[n_, k_] := FromDigits[IntegerDigits[n, 2] /. 0 -> Sequence @@ Table[0, {k}], 2];
    Table[A[n, d-n], {d, 0, 12}, {n, 0, d}] // Flatten (* Jean-François Alcover, Feb 02 2021 *)

Formula

A000120(A(n,k)) = A000120(n) = log_2(A(n,0)+1).
A023416(A(n,k)) = k * A023416(n) for n >= 1.

A191664 Dispersion of A014601 (numbers >2, congruent to 0 or 3 mod 4), by antidiagonals.

Original entry on oeis.org

1, 3, 2, 7, 4, 5, 15, 8, 11, 6, 31, 16, 23, 12, 9, 63, 32, 47, 24, 19, 10, 127, 64, 95, 48, 39, 20, 13, 255, 128, 191, 96, 79, 40, 27, 14, 511, 256, 383, 192, 159, 80, 55, 28, 17, 1023, 512, 767, 384, 319, 160, 111, 56, 35, 18, 2047, 1024, 1535, 768, 639
Offset: 1

Views

Author

Clark Kimberling, Jun 11 2011

Keywords

Comments

Row 1: A000225 (-1+2^n)
Row 2: A000079 (2^n)
Row 3: A055010
Row 4: 3*A000079
Row 5: A153894
Row 6: 5*A000079
Row 7: A086224
Row 8: A005009
Row 9: A052996
For a background discussion of dispersions, see A191426.
...
Each of the sequences (4n, n>2), (4n+1, n>0), (3n+2, n>=0), generates a dispersion. Each complement (beginning with its first term >1) also generates a dispersion. The six sequences and dispersions are listed here:
...
A191663=dispersion of A042948 (0 or 1 mod 4 and >1)
A054582=dispersion of A005843 (0 or 2 mod 4 and >1; evens)
A191664=dispersion of A014601 (0 or 3 mod 4 and >1)
A191665=dispersion of A042963 (1 or 2 mod 4 and >1)
A191448=dispersion of A005408 (1 or 3 mod 4 and >1, odds)
A191666=dispersion of A042964 (2 or 3 mod 4)
...
EXCEPT for at most 2 initial terms (so that column 1 always starts with 1):
A191663 has 1st col A042964, all else A042948
A054582 has 1st col A005408, all else A005843
A191664 has 1st col A042963, all else A014601
A191665 has 1st col A014601, all else A042963
A191448 has 1st col A005843, all else A005408
A191666 has 1st col A042948, all else A042964
...
There is a formula for sequences of the type "(a or b mod m)", (as in the Mathematica program below):
If f(n)=(n mod 2), then (a,b,a,b,a,b,...) is given by
a*f(n+1)+b*f(n), so that "(a or b mod m)" is given by
a*f(n+1)+b*f(n)+m*floor((n-1)/2)), for n>=1.
This sequence is a permutation of the natural numbers. - L. Edson Jeffery, Aug 13 2014

Examples

			Northwest corner:
1...3...7....15...31
2...4...8....16...32
5...11..23...47...95
6...12..24...48...96
9...19..39...79...159
		

Crossrefs

Programs

  • Mathematica
    (* Program generates the dispersion array T of the increasing sequence f[n] *)
    r = 40; r1 = 12;  c = 40; c1 = 12;
    a = 3; b = 4; m[n_] := If[Mod[n, 2] == 0, 1, 0];
    f[n_] := a*m[n + 1] + b*m[n] + 4*Floor[(n - 1)/2]
    Table[f[n], {n, 1, 30}]  (* A014601(n+2): (4+4k,5+4k) *)
    mex[list_] := NestWhile[#1 + 1 &, 1, Union[list][[#1]] <= #1 &, 1, Length[Union[list]]]
    rows = {NestList[f, 1, c]};
    Do[rows = Append[rows, NestList[f, mex[Flatten[rows]], r]], {r}];
    t[i_, j_] := rows[[i, j]];
    TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]] (* A191664 *)
    Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191664  *)
    (* Clark Kimberling, Jun 11 2011 *)
    Grid[Table[2^k*(2*Floor[(n + 1)/2] - 1) - Mod[n, 2], {n, 12}, {k, 12}]] (* L. Edson Jeffery, Aug 13 2014 *)

A206372 a(n) = 14 * 4^n - 1.

Original entry on oeis.org

13, 55, 223, 895, 3583, 14335, 57343, 229375, 917503, 3670015, 14680063, 58720255, 234881023, 939524095, 3758096383, 15032385535, 60129542143, 240518168575, 962072674303, 3848290697215, 15393162788863, 61572651155455, 246290604621823, 985162418487295
Offset: 0

Views

Author

Brad Clardy, Feb 07 2012

Keywords

Crossrefs

Programs

Formula

a(n) = 7*2^(2*n+1) - 1.
a(n) = (A199207(n+1) -3)/2 for n>=0.
From G. C. Greubel, Jan 05 2023: (Start)
a(n) = A005009(2*n+1) - 1.
G.f.: (13 - 10*x)/((1-x)*(1-4*x)).
E.g.f.: 14*exp(4*x) - exp(x). (End)

A212191 Numbers whose squares are the sum of exactly three distinct powers of 2.

Original entry on oeis.org

5, 7, 9, 10, 14, 17, 18, 20, 23, 28, 33, 34, 36, 40, 46, 56, 65, 66, 68, 72, 80, 92, 112, 129, 130, 132, 136, 144, 160, 184, 224, 257, 258, 260, 264, 272, 288, 320, 368, 448, 513, 514, 516, 520, 528, 544, 576, 640, 736, 896, 1025, 1026, 1028, 1032, 1040
Offset: 1

Views

Author

Reinhard Zumkeller, May 03 2012

Keywords

Comments

The finite sequence 5, 7, 9, 10, 14, 17 arises in the following context: squarefree circular words over the ternary alphabet exist for all lengths n except for 5, 7, 9, 10, 14, 17. See Currie (2002), Shur (2010). - N. J. A. Sloane, May 04 2013

Crossrefs

Cf. A000196, A005009 (subsequence).

Programs

  • Haskell
    a212191 n = a212191_list !! (n-1)
    a212191_list = map a000196 a212190_list
  • Mathematica
    Select[Range[1, 1000], Total[IntegerDigits[#^2, 2]] == 3 &] (* T. D. Noe, Dec 07 2012 *)

Formula

a(n)^2 = A212190(n).
Previous Showing 21-30 of 46 results. Next