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-10 of 15 results. Next

A008615 a(n) = floor(n/2) - floor(n/3).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

If the two leading 0's are dropped, this becomes the essentially identical sequence A103221, with g.f. 1/((1-x^2)*(1-x^3)), which arises in many contexts. For example, 1/((1-x^4)*(1-x^6)) is the Poincaré series [or Poincare series] for modular forms of weight w for the full modular group. As generators one may take the Eisenstein series E_4 (A004009) and E_6 (A013973).
Dimension of the space of weight 2n+8 cusp forms for Gamma_0( 1 ).
Apart from initial term(s), dimension of the space of weight 2n cuspidal newforms for Gamma_0( 5 ).
a(n) is the number of ways n can be written as the sum of a positive even number and a nonnegative multiple of 3 and so the number of ways (n-2) can be written as the sum of a nonnegative even number and a nonnegative multiple of 3 and also the number of ways (n+3) can be written as the sum of a positive even number and a positive multiple of 3.
It appears that this is also the number of partitions of 2n+6 that are 4-term arithmetic progressions. - John W. Layman, May 01 2009 [verified by Wesley Ivan Hurt, Jan 17 2021]
a(n) is the number of (n+3)-digit fixed points under the base-3 Kaprekar map A164993 (see A164997 for the list of fixed points). - Joseph Myers, Sep 04 2009
Starting from n=10 also the number of balls in new consecutive hexagonal edges, if an (infinite) chain of balls is winded spirally around the first ball at the center, such that each six steps make an entire winding. - K. G. Stier, Dec 21 2012
In any three consecutive terms at least two of them are equal to each other. - Michael Somos, Mar 01 2014
Number of partitions of (n-2) into parts 2 and 3. - David Neil McGrath, Sep 05 2014
a(n), n >= 0, is also the dimension of S_{2*(n+4)}, the complex vector space of modular cusp forms of weight 2*(n+4) and level 1 (full modular group). The dimension of S_0, S_2, S_4 and S_6 is 0. See, e.g., Ash and Gross, p. 178. Table 13.1. - Wolfdieter Lang, Sep 16 2016
From Wolfdieter Lang, May 08 2017: (Start)
a(n-2) = floor((n-2)/2) - floor((n-2)/3) = floor(n/2) - floor((n+1)/3) is for n >=0 the number of integers k in the interval (n+1)/3 < k <= floor(n/2). This problem appears in the computation of the number of zeros of Chebyshev S(n, x) polynomials (coefficients in A049310) in the open interval (-1, +1). See a comment there. This computation was motivated by a conjecture given in A008611 by Michel Lagneau, Mar 31 2017.
a(n) is also the number of integers k in the closed interval (n+1)/3 <= k <= floor(n/2), which is floor(n/2) - (ceiling((n+1)/3) - 1) for n >= 0 (proof trivial for n+1 == 0 (mod 3) and otherwise). From the preceding statement this a(n) is also a(n-2) + [n == 2 (mod 3)] for n >= 0 (with [statement] = 1 if the statement is true and zero otherwise). This proves the recurrence given by Michael Somos in the formula section. (End)
Assuming the Collatz conjecture to be true, for n > 1, a(n+7) is the row length of the n-th row of A340985. That is, the number of weakly connected components of the Collatz digraph of order n. - Sebastian Karlsson, Feb 23 2021

Examples

			G.f. = x^2 + x^4 + x^5 + x^6 + x^7 + 2*x^8 + x^9 + 2*x^10 + 2*x^11 + 2*x^12 + ...
		

References

  • Avner Ash and Robert Gross, Summing it up, Princeton University Press, 2016, p. 178.
  • D. J. Benson, Polynomial Invariants of Finite Groups, Cambridge, 1993, p. 100.
  • E. Freitag, Siegelsche Modulfunktionen, Springer-Verlag, Berlin, 1983; p. 141, Th. 1.1.
  • R. C. Gunning, Lectures on Modular Forms. Princeton Univ. Press, Princeton, NJ, 1962.
  • J.-M. Kantor, Où en sont les mathématiques, La formule de Molien-Weyl, SMF, Vuibert, p. 79

Crossrefs

Essentially the same as A103221.
First differences of A069905 (and A001399).

Programs

  • Haskell
    a008615 n = n `div` 2 - n `div` 3  -- Reinhard Zumkeller, Apr 28 2014
    
  • Magma
    [Floor(n/2)-Floor(n/3): n in [0..10]]; // Sergei Haller (sergei(AT)sergei-haller.de), Dec 21 2006
    
  • Magma
    a := func< n | n lt 2 select 0 else n eq 2 select 1 else Dimension( ModularForms( PSL2( Integers()), 2*n-4))>; /* Michael Somos, Dec 11 2018 */
    
  • Maple
    a := n-> floor(n/2) - floor(n/3): seq(a(n), n = 0 .. 87);
  • Mathematica
    a[n_]:=Floor[n/2]-Floor[n/3]; Array[a,90,0] (* Vladimir Joseph Stephan Orlovsky, Dec 05 2008; corrected by Harvey P. Dale, Nov 30 2011 *)
    LinearRecurrence[{0, 1, 1, 0, -1}, {0, 0, 1, 0, 1}, 100]; (* Vincenzo Librandi, Sep 09 2015 *)
  • PARI
    {a(n) = (n\2) - (n\3)}; /* Michael Somos, Feb 06 2003 */
    
  • Python
    def A008615(n): return n//2 - n//3 # Chai Wah Wu, Jun 07 2022

Formula

a(n) = a(n-6) + 1 = a(n-2) + a(n-3) - a(n-5). - Henry Bottomley, Sep 02 2000
G.f.: x^2 / ((1-x^2) * (1-x^3)).
From Reinhard Zumkeller, Feb 27 2008: (Start)
a(A016933(n)) = a(A016957(n)) = a(A016969(n)) = n+1.
a(A008588(n)) = a(A016921(n)) = a(A016945(n)) = n. (End)
a(6*k) = k, k >= 0. - Zak Seidov, Sep 09 2012
a(n) = A005044(n+1) - A005044(n-3). - Johannes W. Meijer, Oct 18 2013
a(n) = floor((n+4)/6) - floor((n+3)/6) + floor((n+2)/6). - Mircea Merca, Nov 27 2013
Euler transform of length 3 sequence [0, 1, 1]. - Michael Somos, Mar 01 2014
a(n+2) = a(n) + 1 if n == 0 (mod 3), a(n+2) = a(n) otherwise. - Michael Somos, Mar 01 2014. See the May 08 2017 comment above. - Wolfdieter Lang, May 08 2017
a(n) = -a(-1 - n) for all n in Z. - Michael Somos, Mar 01 2014.
a(n) = A004526(n) - A002264(n). - Reinhard Zumkeller, Apr 28 2014
a(n) = Sum_{i=0..n-2} (floor(i/6)-floor((i-3)/6))*(-1)^i. - Wesley Ivan Hurt, Sep 08 2015
a(n) = a(n+6) - 1 = A103221(n+4) - 1, n >= 0. - Wolfdieter Lang, Sep 16 2016
12*a(n) = 2*n +1 +3*(-1)^n -4*A057078(n). - R. J. Mathar, Jun 19 2019
a(n) = Sum_{k=1..floor((n+3)/2)} Sum_{j=k..floor((2*n+6-k)/3)} Sum_{i=j..floor((2*n+6-j-k)/2)} ([j-k = i-j = 2*n+6-2*i-j-k] - [k = j = i = 2*n+6-i-j-k]), where [ ] is the (generalized) Iverson bracket. - Wesley Ivan Hurt, Jan 17 2021
E.g.f.: (3*(2 + x)*cosh(x) - 2*exp(-x/2)*(3*cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2)) + 3*(x-1)*sinh(x))/18. - Stefano Spezia, Oct 17 2022

A099009 Fixed points of the Kaprekar mapping f(n) = n' - n'', where in n' the digits of n are arranged in descending, in n'' in ascending order.

Original entry on oeis.org

0, 495, 6174, 549945, 631764, 63317664, 97508421, 554999445, 864197532, 6333176664, 9753086421, 9975084201, 86431976532, 555499994445, 633331766664, 975330866421, 997530864201, 999750842001, 8643319766532, 63333317666664
Offset: 1

Views

Author

Klaus Brockhaus, Sep 22 2004

Keywords

Comments

There are no seven-digit fixed points.
Let d(n) denote n repetitions of the digit d. The sequence includes the following for all n>=0: 5(n)499(n)4(n)5, 63(n)176(n)4, 8643(n)1976(n)532. - Jens Kruse Andersen, Oct 04 2004
0's in n giving leading 0's in n'' is allowed.
For every natural number n let n' and n" be the numbers obtained by arranging the digits of n into decreasing and increasing order, and let f(n)=n'-n". It is known that the number 6174 is invariant under this transformation and that applying f a certain number of times to a number n with four digits the numbers 0, 495 or 6174 are always reached. - Vincenzo Librandi, Nov 17 2010
Each term of A055162(n) corresponds to A099009(n+1), with its digits being reordered in the ascending manner. - Alexander R. Povolotsky, Apr 27 2012
All terms of this sequence are divisible by nine, a(n)/9 = A132155(n). - Alexander R. Povolotsky, Apr 29 2012
A055160 differs from this sequence only at the positions of two terms in it: 554999445 and 555499994445. - Alexander R. Povolotsky, May 01 2012
The union of the sequences A214555, A214556, A214557, A214558, A214559 and the element 0 gives the sequence A099009. - Syed Iddi Hasan, Jul 24 2012
The comment made by Jens Kruse Andersen is missing one more family of terms (which starts with one or more digits "9" and ends with the digit "1"): 97508421, 9753086421, 9975084201, 975330866421, 997530864201, 999750842001, ... This family could be generalized (using the same method as in Andersen's comment) and it is actually covered by Syed Iddi Hasan in A214559. Also A214557 and A214558 (both - by Syed Iddi Hasan) are variants of Andersen's 8643(n)1976(n)532. - Alexander R. Povolotsky, Mar 14 2015
Fixed points of A151949. - Reinhard Zumkeller, Mar 23 2015

Examples

			6174 is a fixed point of the mapping and hence a term: 6174 -> 7641 - 1467 = 6174.
		

Crossrefs

In other bases: A163205 (base 2), A164997 (base 3), A165016 (base 4), A165036 (base 5), A165055 (base 6), A165075 (base 7), A165094 (base 8), A165114 (base 9).

Programs

  • Haskell
    a099009 n = a099009_list !! (n-1)
    a099009_list = [x | x <- [0..], a151949 x == x]
    -- Reinhard Zumkeller, Mar 23 2015
    
  • Magma
    a:=func; [k:k in [0..10^7]|a(k)]; // Marius A. Burtea, Sep 12 2019
  • Mathematica
    f[n_] := Block[{d = IntegerDigits@ n, a, b}, a = FromDigits@ Sort@ d; b = FromDigits@ Reverse@ Sort@ d; n == b - a]; Select[Range@ 1000000, f] (* Michael De Vlieger, Mar 20 2015 *)
  • Python
    # (version 2.4) from Tim Peters
    def extend(base, start, n):
        if n == 0:
            yield base
            return
        for i in range(start, 10):
            for x in extend(base + str(i), i, n-1):
                yield x
    def drive(n):
        result = []
        for lo in extend("", 0, n):
            ilo = int(lo)
            if ilo == 0 and n > 1:
                continue
            hi = lo[::-1]
            diff = str(int(hi) - ilo)
            diff = "0" * (n - len(diff)) + diff
            if sorted(diff) == list(lo):
                result.append(diff)
        return sorted(result)
    for n in range(1, 17):
        # print("Length", n)
        # print('-' * 40)
        for r in drive(n):
            print(r, end=', ')
    

Extensions

More terms from Jens Kruse Andersen and Tim Peters (tim(AT)python.org), Oct 04 2004
Corrected by Jens Kruse Andersen, Oct 25 2004

A163205 The non-repetitive Kaprekar binary numbers in decimal.

Original entry on oeis.org

0, 9, 21, 45, 49, 93, 105, 189, 217, 225, 381, 441, 465, 765, 889, 945, 961, 1533, 1785, 1905, 1953, 3069, 3577, 3825, 3937, 3969, 6141, 7161, 7665, 7905, 8001, 12285, 14329, 15345, 15841, 16065, 16129, 24573, 28665, 30705, 31713, 32193, 32385
Offset: 1

Views

Author

Damir Olejar, Jul 23 2009

Keywords

Comments

Same as A160761, but with no repetitions. The numbers also exist in A143088, except that every first and last number is omitted from A143088's pyramid.
From Joseph Myers, Aug 29 2009: (Start)
Note that all base-2 cycles are fixed points.
Initial terms in base 2: 0, 1001, 10101, 101101, 110001, 1011101, 1101001, 10111101, 11011001, 11100001. (End)

Examples

			The number 9 is 1001 in binary. The maximum number using the same number of 0's and 1's is found and the minimum number having the same number of 0's and 1's is found to obtain the equation such as 1100 - 0011 = 1001. Repeating the same procedure gives us the same number and pattern of 0's and 1's. Therefore 9 is one of the Kaprekar numbers. If 9 did not occur before, it is counted as a number that belongs to a sequence and added to a database to skip repetitions. Numbers that end the procedure in 0 are excluded since they are not Kaprekar numbers. A number 9 can also be obtained with, let's say, 1100. Since number 9 already occurred for 1001, the number 9 occurring for 1100 is ignored to avoid repetition.
		

References

  • M. Charosh, Some Applications of Casting Out 999...'s, Journal of Recreational Mathematics 14, 1981-82, pp. 111-118.
  • D. R. Kaprekar, On Kaprekar numbers, J. Rec. Math., 13 (1980-1981), pp. 81-82.

Crossrefs

In other bases: A164997 (base 3), A165016 (base 4), A165036 (base 5), A165055 (base 6), A165075 (base 7), A165094 (base 8), A165114 (base 9), A099009 (base 10).

Programs

  • Java
    import java.util.*; class pattern { public static void main(String args[]) { int mem1 = 0; int mem2 =1; ArrayList memory = new ArrayList(); for (int i = 1; i
    				
  • Mathematica
    nmax = 10^5; f[n_] := Module[{id, sid, min, max}, id = IntegerDigits[n, 2]; min = FromDigits[sid = Sort[id], 2]; max = FromDigits[Reverse[sid], 2]; max - min]; Reap[Do[If[(fpn = FixedPoint[f, n]) > 0, Sow[fpn]], {n, 0, nmax}]][[2, 1]] // Union // Prepend[#, 0]& (* Jean-François Alcover, Apr 23 2017 *)

Formula

1. Sort all integers from the number in descending order.
2. Sort all integers from the number in ascending order.
3. Subtract ascending from descending order to obtain a new number.
4. Repeat the steps 1-3 with a new number until a repetitive sequence is obtained or until a zero is obtained.
5. Call the repetitive sequence's number a Kaprekar number, ignore zeros and repetitions from the set of the final results.

Extensions

Initial zero added for consistency with other bases by Joseph Myers, Aug 29 2009

A164998 Consider the base-3 Kaprekar map n->K(n) defined in A164993. Sequence gives numbers belonging to cycles, including fixed points.

Original entry on oeis.org

0, 32, 52, 184, 320, 484, 580, 1696, 1768, 2008, 5332, 15304, 16024, 16240, 18208, 18424, 19144, 26240, 39364, 48100, 48964, 55360, 137776, 144328, 146488, 147136, 164008, 166168, 166816, 172720, 173368, 175528, 433012, 441652, 520372, 1240024
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Comments

Initial terms in base 3: 0, 1012, 1221, 20211, 102212, 122221, 210111, 2022211, 2102111, 2202101.

Crossrefs

In other bases: A163205 (base 2), A165017 (base 4), A165037 (base 5), A165056 (base 6), A165076 (base 7), A165095 (base 8), A165115 (base 9), A164716 (base 10).

A165016 List of fixed points of the base-4 Kaprekar map A165012.

Original entry on oeis.org

0, 30, 201, 2550, 3369, 3873, 14565, 54441, 62625, 64641, 171990, 234405, 254865, 873129, 954261, 1004193, 1036929, 1044993, 3755685, 4083345, 4165185, 11140950, 13978281, 15285909, 16075425, 16399953, 16599681, 16730625, 16762881
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Comments

Initial terms in base 4: 0, 132, 3021, 213312, 310221, 330201, 3203211, 31102221, 33102201, 33302001.

Crossrefs

In other bases: A163205 (base 2), A164997 (base 3), A165036 (base 5), A165055 (base 6), A165075 (base 7), A165094 (base 8), A165114 (base 9), A099009 (base 10).

A165055 List of fixed points of the base-6 Kaprekar map A165051.

Original entry on oeis.org

0, 105, 5600, 27195, 33860, 42925, 1275170, 1657225, 6018495, 45962330, 47681900, 56319925, 60331825, 277695950, 348285175, 1305060855, 2151904825, 2175976225, 10363227560, 12973622725, 59994427550, 60063064790, 73115587525
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Comments

Initial terms in base 6: 0, 253, 41532, 325523, 420432, 530421, 43155322, 55304201, 332555223, 4321044322.

Crossrefs

In other bases: A163205 (base 2), A164997 (base 3), A165016 (base 4), A165036 (base 5), A165075 (base 7), A165094 (base 8), A165114 (base 9), A099009 (base 10).

A165094 List of fixed points of the base-8 Kaprekar map A165090.

Original entry on oeis.org

0, 21, 252, 147420, 213402, 1711962, 16092433, 76545756, 1068263553, 39258683100, 57497839826, 58573445322, 68675650561, 3680015145170, 3749808363210, 4238480197777, 4397695901697, 20104741893852
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Comments

Initial terms in base 8: 0, 25, 374, 437734, 640632, 6417532, 75306421, 443777334, 7753064201, 444377773334.

Crossrefs

In other bases: A163205 (base 2), A164997 (base 3), A165016 (base 4), A165036 (base 5), A165055 (base 6), A165075 (base 7), A165114 (base 9), A099009 (base 10).

A165036 List of fixed points of the base-5 Kaprekar map A165032.

Original entry on oeis.org

0, 8, 392, 1831056, 48217776, 1217651376, 30502319376, 144640604656, 762863159376, 3774960835776, 19073104859376, 95168749491376, 476835250859376, 2383192380269376, 11320075681132656, 11920919418359376
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Comments

Initial terms in base 5: 0, 13, 3032, 432043211, 44320432101, 4443204321001, 444432043210001, 4332210443322111, 44444320432100001, 443322104433221101.

Crossrefs

In other bases: A163205 (base 2), A164997 (base 3), A165016 (base 4), A165055 (base 6), A165075 (base 7), A165094 (base 8), A165114 (base 9), A099009 (base 10).

A165075 List of fixed points of the base-7 Kaprekar map A165071.

Original entry on oeis.org

0, 1922263344, 94197649008, 96503566608, 4615731883344, 4728721980144, 4744863403344, 226171191723408, 231707706601008, 232498637278608, 232611627241008, 11082390700389744, 11353679929526544, 11392435533669744
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Comments

Initial terms in base 7: 0, 65430653211, 6543206543211, 6654306532101, 654322065443211, 665432065432101, 666543065321001, 65432220654443211, 66543220654432101, 66654320654321001.

Crossrefs

In other bases: A163205 (base 2), A164997 (base 3), A165016 (base 4), A165036 (base 5), A165055 (base 6), A165094 (base 8), A165114 (base 9), A099009 (base 10).

A165114 List of fixed points of the base-9 Kaprekar map A165110.

Original entry on oeis.org

0, 41520, 31531872, 326952560, 2598744000, 23087388720, 1901588877840, 16838844110112, 19656251882912, 154312292512560, 1386833627452800, 12276176375647920, 16416600735609280, 112539509113431072
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Comments

Initial terms in base 9: 0, 62853, 65288533, 753186532, 6632885523, 65528885333, 6653288855323, 65552888853333, 76533188655322, 666332888555223.

Crossrefs

In other bases: A163205 (base 2), A164997 (base 3), A165016 (base 4), A165036 (base 5), A165055 (base 6), A165075 (base 7), A165094 (base 8), A099009 (base 10).
Showing 1-10 of 15 results. Next