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 29 results. Next

A033001 Every run of digits of n in base 3 has length 2.

Original entry on oeis.org

4, 8, 36, 44, 72, 76, 328, 332, 396, 400, 652, 656, 684, 692, 2952, 2960, 2988, 2992, 3568, 3572, 3600, 3608, 5868, 5876, 5904, 5908, 6160, 6164, 6228, 6232, 26572, 26576, 26640, 26644, 26896, 26900, 26928, 26936, 32112, 32120
Offset: 1

Views

Author

Keywords

Comments

See A043291 for the base 2 version (which has a very simple formula), A033002 - A033014 for bases 4 through 16, A033015 - A033029 for the variants with runs of length >= 2. - M. F. Hasler, Feb 01 2014

Programs

  • Mathematica
    Select[Range[10000], Union[Length/@Split[IntegerDigits[#, 3]]]=={2}&] (* Vincenzo Librandi, Feb 05 2014 *)
  • PARI
    is_A033001(n)=!until(!n\=9,bittest(4588304,n%27)||return)
    
  • PARI
    for(n=1,9999,is_A033001(n)&&print1(n",")) \\ (End)
    
  • PARI
    a(n) = my(v=binary(n+1)); v[1]=0; for(i=2,#v, v[i]+=(v[i]>=v[i-1])); 4*fromdigits(v,9); \\ Kevin Ryde, Mar 13 2021

Formula

a(n)=4*A043307(n). - M. F. Hasler, Feb 01 2014

A043307 a(n) = A033001(n)/4.

Original entry on oeis.org

1, 2, 9, 11, 18, 19, 82, 83, 99, 100, 163, 164, 171, 173, 738, 740, 747, 748, 892, 893, 900, 902, 1467, 1469, 1476, 1477, 1540, 1541, 1557, 1558, 6643, 6644, 6660, 6661, 6724, 6725, 6732, 6734, 8028, 8030, 8037, 8038, 8101, 8102, 8118, 8119
Offset: 1

Views

Author

Keywords

Comments

Also: Numbers which, written in base 9, have only digits 0, 1 or 2, and no two adjacent digits equal. - M. F. Hasler, Feb 03 2014

Crossrefs

Programs

  • Maple
    A[1]:= [1,2]:
    for d from 2 to 6 do
      A[d]:= map(t -> seq(9*t+j,j=subs(t mod 9 = NULL, [0,1,2])), A[d-1])
    od:
    seq(op(A[d]),d=1..6); # Robert Israel, Jan 29 2017
  • Mathematica
    Table[FromDigits[#,9]&/@Select[Tuples[{0,1,2},n],Min[Abs[Differences[#]]]>0&],{n,2,5}]// Flatten// Union (* Harvey P. Dale, May 27 2023 *)
  • PARI
    is_A043307(n)=(n=[n])&&!until(!n[1],((n=divrem(n[1],9))[2]<3 && n[1]%3!=n[2])||return) \\ M. F. Hasler, Feb 03 2014
    
  • PARI
    a(n) = my(v=binary(n+1)); v[1]=0; for(i=2,#v, v[i]+=(v[i]>=v[i-1])); fromdigits(v,9); \\ Kevin Ryde, Mar 13 2021

Formula

From Robert Israel, Jan 29 2017: (Start)
If a(n) == 0 (mod 3) then a(2*n+1) = 9*a(n) + 1 else a(2*n+1) = 9*a(n).
If a(n) == 2 (mod 3) then a(2*n+2) = 9*a(n) + 1 else a(2*n+1) = 9*a(n)+2.
a(4k+5) = 9*a(2k+2).
(End)

A043320 Numbers which, written in base 256, have all digits less than 16 and no two adjacent digits equal.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 256, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 512, 513, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 768, 769, 770, 772, 773, 774
Offset: 1

Views

Author

Keywords

Comments

Sequence A033014 consists of the numbers that have all base 16 digits repeated *exactly* twice. (This is equivalent to say that the base-256 digits are 0x00, 0x11, 0x22,... or 0xFF, in hex notation, and no two adjacent base-256 digits are equal.) Thus, these numbers are divisible by 0x11 = 17, and the result of the division is a number which has no other base-256 digits than 0x00, 0x01,... or 0x0F, and no two adjacent digits equal. Conversely, it is clear that exactly these numbers are terms of A033014 when multiplied by 17 = 0x11. - M. F. Hasler, Feb 05 2014

Crossrefs

Programs

  • Mathematica
    Select[Range[20000], Union[Length/@Split[IntegerDigits[#, 16]]]=={2}&]/17 (* Vincenzo Librandi, Feb 06 2014 *)
  • PARI
    is_A043320(n)={(n=[n])&&!until(!n[1], ((n=divrem(n[1], 256))[2]<16 && n[1]%16!=n[2])||return)} \\ M. F. Hasler, Feb 03 2014
    
  • Python
    from itertools import count, islice, groupby
    def A043320_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:set(len(list(g)) for k, g in groupby(hex(17*n)[2:]))=={2},count(max(startvalue,1)))
    A043320_list = list(islice(A043320_gen(),20)) # Chai Wah Wu, Mar 10 2023

Formula

a(n) = A033014(n)/17. [This was initially the definition of the sequence. - M. F. Hasler, Feb 03 2014]

Extensions

New definition by M. F. Hasler, Feb 03 2014

A219664 Repeating part of A220664: First differences of the numbers given as concatenation of permutations of (1,...,m) for sufficiently large m.

Original entry on oeis.org

9, 81, 18, 81, 9, 702, 9, 171, 27, 72, 18, 693, 18, 72, 27, 171, 9, 702, 9, 81, 18, 81, 9, 5913, 9, 81, 18, 81, 9, 1602, 9, 261, 36, 63, 27, 594, 18, 162, 36, 162, 18, 603, 9, 171, 27, 72, 18, 5814, 9, 171, 27, 72, 18, 603, 9, 261, 36, 63, 27, 1584, 27, 63, 36
Offset: 1

Views

Author

Antti Karttunen, Dec 18 2012

Keywords

Comments

First 5!-1 terms are identical to A107346, and the 9!-1 terms are identical to A209280. (Updated by M. F. Hasler, Jan 12 2013, Mar 03 2013)
Because of the self-similar nature of A220664, this sequence can be also constructed by picking appropriate terms from there with the auxiliary sequence A220655, cf. formula.
Similarly, differences between successive permutations of {1,2,...,k} in lexicographic order interpreted as decimal numbers, for any k=2..9, produce the first (k!)-1 terms of this sequence. But for k=10 the result is ill-defined, so we can consider the sequence finite, well-defined only for n=1..362879. [See however the following comment. - Editor's note]
In sequence A030299 it is clearly defined how it extends beyond index n = 1!+2!+...+9! = A007489(9), so the sequence A220664 of its first differences is well-defined up to infinity. (The "result" mentioned above is ill defined because the meaning of "interpreted" is not clear.) But the preceding comment is misleading by speaking of "self similar nature", and the sequence definition as "repeating part" is also misleading: If the sequence is defined to be of finite length 9!-1 (thus equal to A209280), then it is indeed infinitely often repeated as a subsequence (of consecutive terms) in A220664 (even when the latter was defined using concatenation for permutations of more than 9 elements, but then not as differences of the terms following 12345678910 where it was expected, but, e.g., as differences of the terms following 10123456789, etc.).
Since A030299 has been defined through a ("simpler") sum rather than concatenation, the nice mathematical properties of A220664, and even more this sequence A219664, persist beyond n=9!. - M. F. Hasler, Jan 12 2013

Examples

			The first four permutations of nine elements at A030299(A003422(9)..A003422(9)+3) (the terms A030299(46234..46237)) are: 123456789, 123456798, 123456879, 123456897. As 123456897-123456879 = 18, thus we have a(3) = 18.
We could compute the same value from any smaller set of permutations of at least three elements, for example, from the five element permutations used in A107346. In that case, the permutations A030299(A003422(5)..A003422(5)+3) (the terms A030299(34..37)) are: 12345, 12354, 12435, 12453, ... and we get the same result, a(3) = 12453-12435 = 18.
		

Crossrefs

Programs

  • PARI
    A219664(n)=for(k=2,n+1, k!>n || next; k=vecsort( vector( (#k=vector(k,j,10^j)~\10)!,i,numtoperm(#k,i)*k )); return(k[n+1]-k[n]))  \\ (It is of course more efficient to calculate a whole vector of the first k!-1 terms. Also, for n>9!, this might yield incorrect terms.) - M. F. Hasler, Jan 12 2013
  • Scheme
    (define (A219664 n) (A220664 (A220655 n)))
    

Formula

a(n) = A220664(A220655(n)).
a(n) = 9*A217626(n).

A033002 Every run of digits of n in base 4 has length 2.

Original entry on oeis.org

5, 10, 15, 80, 90, 95, 160, 165, 175, 240, 245, 250, 1285, 1290, 1295, 1440, 1445, 1455, 1520, 1525, 1530, 2565, 2570, 2575, 2640, 2650, 2655, 2800, 2805, 2810, 3845, 3850, 3855, 3920, 3930, 3935, 4000, 4005, 4015, 20560
Offset: 1

Views

Author

Keywords

Comments

See A043291 and A033001 through A033014 for the analog in other bases, A033015 - A033029 for the variants with run lengths >= 2. - M. F. Hasler, Feb 04 2014

Programs

  • Mathematica
    Select[Range[10000], Union[Length/@Split[IntegerDigits[#, 4]]]=={2}&] (* Vincenzo Librandi, Feb 05 2014 *)

Formula

a(n) = 5*A043308(n) (= 5*n for n<4). - M. F. Hasler, Feb 04 2014

A033008 Every run of digits of n in base 10 has length 2.

Original entry on oeis.org

11, 22, 33, 44, 55, 66, 77, 88, 99, 1100, 1122, 1133, 1144, 1155, 1166, 1177, 1188, 1199, 2200, 2211, 2233, 2244, 2255, 2266, 2277, 2288, 2299, 3300, 3311, 3322, 3344, 3355, 3366, 3377, 3388, 3399, 4400, 4411, 4422, 4433
Offset: 1

Views

Author

Keywords

Comments

See A043291 and A033001 through A033014 for the analog in other bases, A033015 - A033029 for the variants with run lengths >= 2. - M. F. Hasler, Feb 02 2014

Programs

  • Mathematica
    Select[Range[10000], Union[Length/@Split[IntegerDigits[#, 10]]]=={2}&] (* Vincenzo Librandi, Feb 05 2014 *)

Formula

a(n) = 11*A043314(n) (= 11*n for n<10). - M. F. Hasler, Feb 02 2014

A033003 Every run of digits of n in base 5 has length 2.

Original entry on oeis.org

6, 12, 18, 24, 150, 162, 168, 174, 300, 306, 318, 324, 450, 456, 462, 474, 600, 606, 612, 618, 3756, 3762, 3768, 3774, 4050, 4056, 4068, 4074, 4200, 4206, 4212, 4224, 4350, 4356, 4362, 4368, 7506, 7512, 7518, 7524, 7650, 7662
Offset: 1

Views

Author

Keywords

Comments

See A043291 and A033001 through A033014 for the analog in other bases, A033015 - A033029 for the variants with run lengths >= 2. - M. F. Hasler, Feb 02 2014

Programs

  • Mathematica
    Select[Range[10000],Union[Length/@Split[IntegerDigits[#, 5]]]=={2}&] (* Vincenzo Librandi, Feb 05 2014 *)

Formula

a(n) = 6*A043309(n) (= 6*n for n<5). - M. F. Hasler, Feb 02 2014

A033007 Every run of digits of n in base 9 has length 2.

Original entry on oeis.org

10, 20, 30, 40, 50, 60, 70, 80, 810, 830, 840, 850, 860, 870, 880, 890, 1620, 1630, 1650, 1660, 1670, 1680, 1690, 1700, 2430, 2440, 2450, 2470, 2480, 2490, 2500, 2510, 3240, 3250, 3260, 3270, 3290, 3300, 3310, 3320, 4050
Offset: 1

Views

Author

Keywords

Comments

See A043291 and A033001 through A033014 for the analog in other bases, A033015 - A033029 for the variants with run lengths >= 2. - M. F. Hasler, Feb 02 2014

Programs

  • Mathematica
    Select[Range[10000], Union[Length/@Split[IntegerDigits[#, 9]]]=={2}&] (* Vincenzo Librandi, Feb 05 2014 *)

Formula

a(n) = 10*A043313(n) (= 10*n for n<9). - M. F. Hasler, Feb 02 2014

A033010 Numbers each of whose runs of digits in base 12 has length 2.

Original entry on oeis.org

13, 26, 39, 52, 65, 78, 91, 104, 117, 130, 143, 1872, 1898, 1911, 1924, 1937, 1950, 1963, 1976, 1989, 2002, 2015, 3744, 3757, 3783, 3796, 3809, 3822, 3835, 3848, 3861, 3874, 3887, 5616, 5629, 5642, 5668, 5681, 5694, 5707, 5720, 5733, 5746, 5759, 7488, 7501
Offset: 1

Views

Author

Keywords

Comments

See A043291 and A033001 through A033014 for the analog in other bases, A033015 - A033029 for the variants with run lengths >= 2. - M. F. Hasler, Feb 02 2014
Numbers without repeating adjacent digits for which all digits are divisible by 13, in base 144. Consequently there are 11^n n-digit members of this sequence (base 144) and so (11^(n+1)-1)/10 members of this sequence below 144^n. - Charles R Greathouse IV, Feb 02 2014

Programs

  • Mathematica
    Select[Range[10000], Union[Length/@Split[IntegerDigits[#, 12]]]=={2}&] (* Vincenzo Librandi, Feb 05 2014 *)
  • Python
    from sympy.ntheory import digits
    from itertools import groupby
    def ok(n):
      return all(len(list(g))==2 for k, g in groupby(digits(n, 12)[1:]))
    print(list(filter(ok, range(1, 7502)))) # Michael S. Branicky, Apr 27 2021

Formula

a(n) = 13*A043316(n) (= 13*n for n < 12). - M. F. Hasler, Feb 02 2014

A048340 a(n) in base 16 is a repdigit.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255, 273, 546, 819, 1092, 1365, 1638, 1911, 2184, 2457, 2730, 3003, 3276, 3549, 3822, 4095, 4369, 8738, 13107, 17476, 21845, 26214, 30583
Offset: 0

Views

Author

Patrick De Geest, Feb 15 1999

Keywords

Crossrefs

Programs

  • Mathematica
    Union[Flatten[Table[FromDigits[PadRight[{}, n, d], 16], {n, 0, 50}, {d, 15}]]] (* Vincenzo Librandi, Feb 06 2014 *)
  • Python
    A048340_list = [0] + [int(d*l,16) for l in range(1,10) for d in '123456789abcdef'] # Chai Wah Wu, May 30 2016

Formula

From Chai Wah Wu, May 30 2016: (Start)
a(n) = 17*a(n-15) - 16*a(n-30) for n > 29.
x*(15*x^14 + 14*x^13 + 13*x^12 + 12*x^11 + 11*x^10 + 10*x^9 + 9*x^8 + 8*x^7 + 7*x^6 + 6*x^5 + 5*x^4 + 4*x^3 + 3*x^2 + 2*x + 1)/(16*x^30 - 17*x^15 + 1).
(End)
a(n) = (n - 15*floor((n-1)/15))*(16^floor((n+14)/15) - 1)/15. - Ilya Gutkovskiy, May 30 2016
Showing 1-10 of 29 results. Next