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-3 of 3 results.

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

Original entry on oeis.org

1, 2, 7, 16, 29, 46, 67, 92, 121, 154, 191, 232, 277, 326, 379, 436, 497, 562, 631, 704, 781, 862, 947, 1036, 1129, 1226, 1327, 1432, 1541, 1654, 1771, 1892, 2017, 2146, 2279, 2416, 2557, 2702, 2851, 3004, 3161, 3322, 3487, 3656, 3829, 4006, 4187, 4372, 4561
Offset: 0

Views

Author

Mohammad K. Azarian, Jul 26 2007

Keywords

Comments

Maximum number of regions determined by n bent lines (or angular sectors). See Concrete Mathematics reference.
A "bent line" may also be regarded as a "long-legged letter V", meaning a letter V with both line segments extended to infinity. See A117625 for the analogous sequence for a long-legged Z. - N. J. A. Sloane, Jun 18 2025
a(n)*Pi is the total length of half circle spiral after n rotations. It is formed as irregular spiral with two center points. At the 2nd stage, there are two alternatives: (1) select 2nd half circle radius, r2 = 2, the sequence will be A014105 or (2) select r2 = 0, the sequence will be A130883. See illustration in links. - Kival Ngaokrajang, Jan 19 2014
A128218(a(n)) = 2*n+1 and A128218(m) != 2*n+1 for m < a(n). - Reinhard Zumkeller, Jun 20 2015

References

  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics, 2nd ed., Addison-Wesley, Reading, MA, 1994, pp. 7-8, and Problem 1.18, pages 19 and 500.

Crossrefs

See also A117625.
A row of the array in A386478.

Programs

Formula

a(n) = a(n-1) + 4*n - 3 for n > 0, a(0)=1. - Vincenzo Librandi, Nov 23 2010
a(n) = A000124(2*n) - 2*n. - Geoffrey Critzer, Mar 30 2011
O.g.f.: (4*x^2-x+1)/(1-x)^3. - Geoffrey Critzer, Mar 30 2011
a(n) = 2*a(n-1) - a(n-2) + 4. - Eric Werley, Jun 27 2011
a(0)=1, a(1)=2, a(2)=7; for n > 2, a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - Harvey P. Dale, Jul 20 2011
a(n) = A128918(2*n). - Reinhard Zumkeller, Oct 27 2013
a(n) = 1 + A000384(n). - Omar E. Pol, Apr 27 2017
E.g.f.: (2*x^2 + x + 1)*exp(x). - G. C. Greubel, Jul 14 2017
a(n) = A152947(2*n+1). - Franck Maminirina Ramaharo, Jan 10 2018

A152271 a(n)=1 for even n and (n+1)/2 for odd n.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 1, 14, 1, 15, 1, 16, 1, 17, 1, 18, 1, 19, 1, 20, 1, 21, 1, 22, 1, 23, 1, 24, 1, 25, 1, 26, 1, 27, 1, 28, 1, 29, 1, 30, 1, 31, 1, 32, 1, 33, 1, 34, 1, 35, 1, 36, 1, 37, 1, 38, 1, 39, 1, 40, 1, 41, 1, 42, 1, 43, 1, 44
Offset: 0

Views

Author

Philippe Deléham, Dec 01 2008

Keywords

Comments

A000012 and A000027 interleaved. - Omar E. Pol, Mar 12 2012
Run lengths in A128218. - Reinhard Zumkeller, Jun 20 2015
a(n+1) is the number of reversible binary strings of length n+1 with Hamming weight 1 or 2 such that the 1's are separated by an even number of 0's. - Christian Barrientos, Jan 28 2019
Simple continued fraction of -1 + BesselJ(1,2)/BesselJ(2,2) = 1/(1 + 1/(1 + 1/(1 + 1/(2 + 1/(1 + 1/(3 + 1/(1 + 1/(4 + 1/(1 + ... ))))))))). - Peter Bala, Oct 06 2023

Examples

			G.f. = 1 + x + x^2 + 2*x^3 + x^4 + 3*x^5 + x^6 + 4*x^7 + x^8 + ... - _Michael Somos_, Mar 26 2022
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a152271 = a057979 . (+ 2)
    a152271_list = concat $ transpose [repeat 1, [1..]]
    -- Reinhard Zumkeller, Aug 11 2014
    
  • Mathematica
    Table[If[EvenQ[n],1,(n+1)/2],{n,0,120}] (* or *) LinearRecurrence[{0,2,0,-1},{1,1,1,2},120] (* or *) Riffle[Range[60],1,{1,-1,2}] (* Harvey P. Dale, Jan 20 2018 *)
  • PARI
    Vec((1+x-x^2)/(1-2*x^2+x^4)+O(x^99)) \\ Charles R Greathouse IV, Jan 12 2012
    
  • PARI
    a(n)=gcd(n+1,(n+1)\2) \\ Charles R Greathouse IV, Mar 13 2012
    
  • Python
    def A152271(n): return n+1>>1 if n&1 else 1 # Chai Wah Wu, Jan 04 2024

Formula

a(n) = 2*a(n-2) - a(n-4) with a(0)=a(1)=a(2)=1 and a(3)=2.
a(n) = (a(n-2) + a(n-3))/a(n-1).
G.f.: (1 + x - x^2)/(1 - 2*x^2 + x^4).
a(n) = A057979(n+2).
a(n)*a(n+1) = floor((n+2)/2) = A008619(n). - Paul Barry, Feb 27 2009
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k,k)*0^floor((n-2k)/2). - Paul Barry, Feb 27 2009
a(n) = gcd(floor((n+1)/2), (n+1)). - Enrique Pérez Herrero, Mar 13 2012
G.f.: U(0) where U(k) = 1 + x*(k+1)/(1 - x/(x + (k+1)/U(k+1))) ; (continued fraction, 3-step). - Sergei N. Gladkovskii, Oct 04 2012
E.g.f.: ((2 + x)*cosh(x) + sinh(x))/2. - Stefano Spezia, Mar 26 2022
a(n) = (-1)^n * a(-2-n) for all n in Z. - Michael Somos, Mar 26 2022

A128217 Nonnegative integers n such that the square-root of n differs from its nearest integer by less than 1/4.

Original entry on oeis.org

0, 1, 4, 5, 8, 9, 10, 15, 16, 17, 18, 23, 24, 25, 26, 27, 34, 35, 36, 37, 38, 39, 46, 47, 48, 49, 50, 51, 52, 61, 62, 63, 64, 65, 66, 67, 68, 77, 78, 79, 80, 81, 82, 83, 84, 85, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125
Offset: 1

Views

Author

John W. Layman, Feb 19 2007

Keywords

Comments

The squares are a subsequence; apparently A052928(n-1) = number of terms between (n-1)^2 and n^2. - Reinhard Zumkeller, Jun 20 2015

Crossrefs

Cf. A063656. See the first differences in A128218.

Programs

  • Haskell
    a128217 n = a128217_list !! (n-1)
    a128217_list = filter f [0..] where
       f x = 4 * abs (root - fromIntegral (round root)) < 1
             where root = sqrt $ fromIntegral x
    -- Reinhard Zumkeller, Jun 20 2015
    
  • Mathematica
    nsrQ[n_]:=Module[{sr=Sqrt[n]},Abs[First[sr-Nearest[{Floor[sr], Ceiling[sr]},sr]]]<1/4]; Select[Range[0,150],nsrQ] (* Harvey P. Dale, Aug 19 2011 *)
  • Python
    from itertools import count, islice
    from math import isqrt
    def A128217_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:(m:=n<<4)<(k:=(isqrt(n)<<2)+1)**2 or m>(k+2)**2, count(max(startvalue,0)))
    A128217_list = list(islice(A128217_gen(),40)) # Chai Wah Wu, Jun 06 2025

Extensions

Offset changed by Reinhard Zumkeller, Jun 20 2015
Showing 1-3 of 3 results.