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.

Showing 1-5 of 5 results.

A171884 Lexicographically earliest injective nonnegative sequence a(n) satisfying |a(n+1) - a(n)| = n for all n.

Original entry on oeis.org

0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24, 8, 25, 43, 62, 42, 63, 41, 64, 40, 65, 39, 66, 38, 67, 37, 68, 36, 69, 35, 70, 34, 71, 33, 72, 32, 73, 31, 74, 30, 75, 29, 76, 28, 77, 27, 78, 26, 79, 133, 188, 132, 189, 131, 190, 130, 191, 129, 192, 128, 193, 127, 194
Offset: 1

Views

Author

Robert Munafo, Mar 11 2010

Keywords

Comments

The map n -> a(n) is an injective map to the nonnegative integers, i.e., no two terms are identical.
Appears not to contain numbers from the following sets (grouped intentionally): {4, 5}, {14, 15, 16, 17, 18, 19}, {44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61}, etc. The numbers of terms in these groups appears to be A008776. - Paul Raff, Mar 15 2010 [This is correct: by the formula below, a(2*3^k+1...2*3^(k+1)) take all the values in the range [3^(k+1)-1, 5*3^k-2] U [7*3^k-1, 3^(k+2)-2], so the numbers not appearing are those in the range [5*3^k-1, 7*3^k-2] for some k. - Jianing Song, Oct 07 2022]
The first 23 terms are shared with Recamán's sequence A005132, but from then on they are different. - Philippe Deléham, Mar 01 2013, Omar E. Pol, Jul 01 2013
From M. F. Hasler, May 09 2013: (Start)
It appears that the starting points of the gaps (4, 14, 44, 134, 404, 1214, ...) are given by A181655(2n) = A198643(n-1), and thus the ending points (5, 19, 61, ...) by A181655(2n) + A048473(n-1).
The first differences have signs (grouped intentionally): +++, -, +++, -+-+-+-+- (5 times "-"), +++, -+...+- (17 times "-"), +++, ... where the number of minus signs is again given by A048473 = A008776-1. (End)
A correspondent, Dennis Reichard, conjectures that (i) a(n) <= 3.5*n for all n and (ii) the sequence covers 2/3 of all natural numbers. - N. J. A. Sloane, Jun 30 2018 [(i) is true: the indices of records for a(n)/n are n = 1, 2, 3, 4, 6, 7, and 2*3^k+2 for k >= 1, with record values 0, 1/2, 1, 1, 3/2, 7/6, 13/7, and (7*3^k-1)/(2*3^k+2) for k >= 1, so a(n) <= 3.5*n. (ii) needs further justification: the lower natural density is lim_{k->+oo} #{terms <= 7*3^k-2}/(7*3^k-2) = lim_{k->+oo} (4*3^k-1)/(7*3^k-2) = 4/7, and the upper natural density is lim_{k->+oo} #{terms <= 5*3^k-2}/(5*3^k-2) = lim_{k->+oo} (4*3^k-1)/(5*3^k-2) = 4/5. - Jianing Song, Oct 07 2022]

Examples

			We begin with 0, 0+1=1, 1+2=3. 3-3=0 cannot be the next term because 0 is already in the sequence so we go to 3+3=6. The next could be 6-4=2 or 6+4=10 but we choose 2 because it is smaller.
		

Crossrefs

Cf. A005132, which allows duplicate values.
Cf. also A118201, in which every value of a(n) and of |a(n+1)-a(n)| occurs exactly once, but does not ensure that the latter is strictly increasing.

Programs

  • Mathematica
    A171884[{}, , ] := {};
    A171884[L_List, max_Integer, True] := If[Length[L] == max, L, With[{n = Length[L]},
      If[Last[L] - n < 1 || MemberQ[L, Last[L] - n],
        If[MemberQ[L, Last[L] + n],
           A171884[Drop[L, -1], max, False],
           A171884[Append[L, Last[L] + n], max, True]],
        A171884[Append[L, Last[L] - n], max, True]]]]
    A171884[L_List, max_Integer, False] := With[{n = Length[L]},
      If[MemberQ[L, Last[L] + n],
         A171884[Drop[L, -1], max, False],
         A171884[Append[L, Last[L] + n], max, True]]]
    A171884[{0}, 200, True] (* Paul Raff, Mar 15 2010 *)
  • PARI
    A171884_upto(N,a=0,t=2)=vector(N,k, a+=if(!bitand(k,1), k-1, t-=1, 1-k, t=k-1)) \\ or:
    A171884_upto(N,a)=vector(N,k,a+=if(bitand(k,1)&&k\2!=3^valuation(k-(k>1),3),1-k,k-1)) \\ M. F. Hasler, Apr 05 2019
    a(n) = if(n<=2, n-1, my(k=logint((n-1)\2, 3), r=n-2*3^k); if(r%2, 5*3^k-1-(r+1)/2, 7*3^k-2+r/2)) \\ Jianing Song, Oct 07 2022

Formula

a(n+1) = a(n) +- n with - iff n is even but not n = 2 + 2*3^k. (Cf. comment from May 09 2013.) - M. F. Hasler, Apr 05 2019
a(2*3^k + 2*r - 1) = 5*3^k - 1 - r, a(2*3^k + 2*r) = 7*3^k - 2 + r, for k >= 0 and 1 <= r <= 2*3^k. - Jianing Song, Oct 07 2022

Extensions

Definition edited by M. F. Hasler, Apr 01 2019

A240917 a(n) = 2*3^(2*n) - 3*3^n + 1.

Original entry on oeis.org

0, 10, 136, 1378, 12880, 117370, 1060696, 9559378, 86073760, 774781930, 6973391656, 62761587778, 564857478640, 5083726873690, 45753570561016, 411782221142578, 3706040248563520, 33354363011912650, 300189269431736776, 2701703431859199778
Offset: 0

Views

Author

Kival Ngaokrajang, Apr 14 2014

Keywords

Comments

a(n) is the total number of holes of a triflake-like fractal (fan pattern) after n iterations. The scale factor for this case is 1/3, but for the actual triflake case, it is 1/2, i.e., Sierpiński triangle. The total number of sides is 3*(A198643-1). The perimeter seems to converge to 10/6.

Crossrefs

Cf. A198643, A240523 (pentaflake), A240671 (heptaflake), A240572 (octaflake), A240733 (nonaflake), A240734 (decaflake), A240840 (hendecaflake), A240735 (dodecaflake), A240841 (tridecaflake).

Programs

  • Maple
    A240917:=n->2*3^(2*n) - 3*3^n + 1; seq(A240917(n), n=0..30); # Wesley Ivan Hurt, Apr 15 2014
  • Mathematica
    Table[2*3^(2 n) - 3*3^n + 1, {n, 0, 30}] (* Wesley Ivan Hurt, Apr 15 2014 *)
  • PARI
    a(n)= 2*3^(2*n) - 3*3^n + 1
           for(n=0,100,print1(a(n),", "))
    
  • PARI
    concat(0, Vec(-2*x*(3*x+5)/((x-1)*(3*x-1)*(9*x-1)) + O(x^100))) \\ Colin Barker, Apr 15 2014

Formula

a(n) = 2*A007742(A003462(n)).
a(n) = 9*(a(n-1) + 2*A048473(n-1)) + 1.
From Colin Barker, Apr 15 2014: (Start)
a(n) = 1-3^(1+n)+2*9^n.
a(n) = 13*a(n-1)-39*a(n-2)+27*a(n-3).
G.f.: -2*x*(3*x+5) / ((x-1)*(3*x-1)*(9*x-1)). (End).

A181655 Expansion of (1+2x-x^3+x^4)/(1-4x^2+3x^4).

Original entry on oeis.org

1, 2, 4, 7, 14, 22, 44, 67, 134, 202, 404, 607, 1214, 1822, 3644, 5467, 10934, 16402, 32804, 49207, 98414, 147622, 295244, 442867, 885734, 1328602, 2657204, 3985807, 7971614, 11957422, 23914844, 35872267, 71744534, 107616802, 215233604
Offset: 0

Views

Author

Paul Barry, Nov 03 2010

Keywords

Comments

Row sums of A181654.

Crossrefs

Cf. A060816, A198643 (bisections).

Programs

  • Mathematica
    CoefficientList[Series[(1+2x-x^3+x^4)/(1-4x^2+3x^4),{x,0,40}],x] (* or *) Join[{1},LinearRecurrence[{0,4,0,-3},{2,4,7,14},40]] (* Harvey P. Dale, Jan 11 2012 *)
  • PARI
    A181655(n)=if(bitand(n,1), 3^(n\2)*5\2, n, 3^(n\2-1)*5-1, 1) \\ M. F. Hasler, Apr 06 2019

Formula

G.f.: (1+2*x-x^3+x^4)/((1-x^2)*(1-3*x^2)).
a(n) = 5*A038754(n+1)/6 - A040001(n)/2. - R. J. Mathar, May 14 2016
a(2n-1) = A060816(n-1), a(2n) = A198643(n-1); n >= 1. a(n+1) = 2*a(n) if n is odd. - M. F. Hasler, Apr 06 2019

A355492 a(n) = 7*3^n - 2.

Original entry on oeis.org

5, 19, 61, 187, 565, 1699, 5101, 15307, 45925, 137779, 413341, 1240027, 3720085, 11160259, 33480781, 100442347, 301327045, 903981139, 2711943421, 8135830267, 24407490805, 73222472419, 219667417261, 659002251787, 1977006755365, 5931020266099, 17793060798301, 53379182394907
Offset: 0

Views

Author

Jianing Song, Oct 07 2022

Keywords

Comments

Right ending points of the gaps in A171884. The left ending points are given in A198643.

Examples

			The numbers not appearing in A171884 are those in the range [5*3^k-1, 7*3^k-2] for some k; that is, [4, 5] U [14, 19] U [44, 61] U ...
		

Crossrefs

Programs

  • Mathematica
    7*3^Range[0, 50] - 2 (* Paolo Xausa, Jun 10 2024 *)
  • PARI
    a(n)=7*3^n-2

Formula

G.f.: (5-x)/((1-x)*(1-3*x)).
E.g.f.: 7*exp(3*x) - 2*exp(x).

A238207 Square array T(n,k), n>=0, k>=0, read by antidiagonals, where T(0,k) is A032766(k) and T(n,k) = 3*T(n-1,k) + 2 for n>0.

Original entry on oeis.org

0, 1, 2, 3, 5, 8, 4, 11, 17, 26, 6, 14, 35, 53, 80, 7, 20, 44, 107, 161, 242, 9, 23, 62, 134, 323, 485, 728, 10, 29, 71, 188, 404, 971, 1457, 2186, 12, 32, 89, 215, 566, 1214, 2915, 4373, 6560, 13, 28, 98, 269, 647, 1700, 3644, 8747, 13121, 19682, 15, 41, 116
Offset: 0

Views

Author

Philippe Deléham, Feb 20 2014

Keywords

Comments

Permutation of nonnegative integers.

Examples

			Square array begins:
0, 1, 3, 4, 6, 7, 9, 10, ...
2, 5, 11, 14, 20, 23, 29, 32, ...
8, 17, 35, 44, 62, 71, 89, 98, ...
26, 53, 107, 134, 188, 215, 269, 296, ...
80, 161, 323, 404, 566, 647, 809, 890, ...
242, 485, 971, 1214, 1700, 1943, 2429, 2672, ...
728, 1457, 2915, 3644, 5102, 5831, 7289, 8018, ...
2186, 4373, 8747, 10934, 15308, 17495, 21869, 24056, ...
...
		

Crossrefs

Formula

T(n,k) = T(0,k)*3^n + T(n,0) where T(0,k) = A032766(k) and T(n,0) = 3^n - 1 = A024023(n).
Showing 1-5 of 5 results.