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 30 results.

A281571 Smallest k such that (the base-2 number formed by concatenating k consecutive base-2 numbers starting at n) is prime, or 0 if no such k exists.

Original entry on oeis.org

15, 1, 1, 2, 1, 26, 1, 2, 31
Offset: 1

Views

Author

Paolo P. Lava, Jan 24 2017

Keywords

Comments

The first primes reached are 485398038695407, 2, 3, 37, 5, 288368629084891241583296816292460511, 7, 137, 55212283888448697916635329662406145945631873447, ...
Except for the second term, n and a(n) have the same parity, i.e., a(n) == n (mod 2). Is it proved (or can it be disproved) that the required k exists for all n? a(10), a(21), a(24), a(38), a(52), a(55) are larger than 1500, if they exist. - M. F. Hasler, Apr 26 2017
a(10) > 40000. Terms at indices 24, 38, 55, 56, 57, 60, 62, 65, 66, 76, 78, 91, 92, 95 are > 20000. A large known term is a(330) = 9376. - Hans Havermann, May 17 2017

Examples

			a(1) = 15 because we have to concatenate the base-2 numbers from 1 to 15 to reach the first prime. In fact concat(1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111) =
1101110010111011110001001101010111100110111101111, which is prime (in base 10 it is 485398038695407).
		

Crossrefs

Cf. A244424 for the base-10 variant.

Programs

  • Maple
    P:=proc(q) local a,b,k,n; for n from 1 to q do
    if isprime(n) then print(1); else a:=convert(n,binary,decimal);
    for k from n+1 to q do b:=convert(k,binary,decimal); a:=a*10^(ilog10(b)+1)+b; if isprime(convert(a,decimal,binary))
    then print(k-n+1); break; fi; od; fi; od; end: P(10^10);
  • Mathematica
    With[{nn = 2^10}, Table[Module[{k = n, w = IntegerDigits[n, 2]}, While[And[! PrimeQ[FromDigits[w, 2]], k - n < nn], k++; w = Join[w, IntegerDigits[k, 2]]]; If[k - n >= nn, -1, k - n + 1]], {n, 50}]] (* Michael De Vlieger, Apr 26 2017, with -1 indicating values of k > limit nn *)
  • PARI
    a(n,c=1,m=n)=while(!ispseudoprime(n),c++;n=n<<#binary(m++)+m);c

Formula

a(n) = 1 if n is prime.

Extensions

Edited by Max Alekseyev, Apr 26 2017.
Further edits from N. J. A. Sloane, Apr 26 2017
a(18) = 586, a(28) = 934, a(35) = 947, a(51) = 1325 (PRP), and further edits from M. F. Hasler, Apr 26 2017

A333920 a(n) is the least k such that the binary representation of n appears as a substring in the concatenation of the binary representations of 0, 1, ..., k.

Original entry on oeis.org

0, 1, 2, 2, 4, 3, 2, 4, 8, 5, 10, 3, 4, 3, 4, 8, 16, 9, 5, 10, 19, 11, 22, 4, 8, 5, 10, 3, 4, 7, 8, 16, 32, 17, 9, 18, 36, 5, 10, 20, 35, 19, 11, 11, 38, 22, 4, 8, 16, 9, 5, 13, 20, 11, 22, 4, 8, 5, 20, 7, 8, 15, 16, 32, 64, 33, 17, 34, 9, 35, 18, 36, 69, 37
Offset: 0

Views

Author

Rémy Sigrist, Apr 10 2020

Keywords

Comments

Every nonnegative integer appears finitely many times in this sequence.

Crossrefs

Cf. A047778, A161373, A161374, A333921 (decimal variant).

Programs

  • PARI
    a(n, base=2) = { my (w=base^#digits(n, base), m=0); for (k=0, oo, my (d=if (k, digits(k, base), [0])); for (i=1, #d, m=(base*m+d[i])%w; if (m==n, return (k)))) }

Formula

a(n) <= n with equality iff n belongs to A161374.
a(A047778(n)) = n for any n > 0.

A350510 Square array read by descending antidiagonals: A(n,k) is the least number m such that the base-n expansion of m contains the base-n expansions of 1..k as substrings.

Original entry on oeis.org

1, 2, 1, 6, 5, 1, 12, 11, 6, 1, 44, 38, 27, 7, 1, 44, 95, 75, 38, 8, 1, 92, 285, 331, 194, 51, 9, 1, 184, 933, 1115, 694, 310, 66, 10, 1, 1208, 2805, 4455, 3819, 1865, 466, 83, 11, 1, 1256, 7179, 17799, 16444, 8345, 3267, 668, 102, 12, 1
Offset: 2

Views

Author

Davis Smith, Jan 02 2022

Keywords

Examples

			Square array begins:
n/k|| 1 |  2 |   3 |    4 |     5 |      6 |       7 |        8 |
================================================================|
2  || 1 |  2 |   6 |   12 |    44 |     44 |      92 |      184 |
3  || 1 |  5 |  11 |   38 |    95 |    285 |     933 |     2805 |
4  || 1 |  6 |  27 |   75 |   331 |   1115 |    4455 |    17799 |
5  || 1 |  7 |  38 |  194 |   694 |   3819 |   16444 |    82169 |
6  || 1 |  8 |  51 |  310 |  1865 |   8345 |   55001 |   289577 |
7  || 1 |  9 |  66 |  466 |  3267 |  22875 |  123717 |   947260 |
8  || 1 | 10 |  83 |  668 |  5349 |  42798 |  342391 |  2177399 |
9  || 1 | 11 | 102 |  922 |  8303 |  74733 |  672604 |  6053444 |
10 || 1 | 12 | 123 | 1234 | 12345 | 123456 | 1234567 | 12345678 |
11 || 1 | 13 | 146 | 1610 | 17715 | 194871 | 2143588 | 23579476 |
		

Crossrefs

The first n - 1 terms of rows: 2: A047778, 3: A048435, 4: A048436, 5: A048437, 6: A048438, 7: A048439, 8: A048440, 9: A048441, 10: A007908, 11: A048442, 12: A048443, 13: A048444, 14: A048445, 15: A048446, 16: A048447.

Programs

  • Mathematica
    T[n_,k_]:=(m=0;While[!ContainsAll[Subsequences@IntegerDigits[++m,n],IntegerDigits[Range@k,n]]];m);Flatten@Table[T[1+i,j+1-i],{j,9},{i,j}] (* Giorgos Kalogeropoulos, Jan 09 2022 *)
  • PARI
    A350510_rows(n,k,N=0)= my(L=List(concat(apply(z->fromdigits([1..z],n),[1..n-1]),if(n>2,fromdigits(concat([1,0],[2..n-1]),n),[]))),T1(x)=digits(x,n),T2(x)=fromdigits(x,n),A(x)=my(S=T1(x));setbinop((y,z)->T2(S[y..z]),[1..#S]),N=if(N,N,L[#L]),A1=A(N));while(#Lsetsearch(A1,z),[1..#L+1])),A1=A(N++));listput(L,N));Vec(L)

Formula

For k < n, A(n,k) = A(n,k - 1)*n + k = Sum_{i=1..k} i*(n^(k - i)).
A(n,n) = A049363(n).
A(n,2) = A057544(n).
For n > 3, A(n,3) = A102305(n).
A(n,n - 1) = A023811(n).

A101933 Concatenate the first n positive integers written in binary (with each integer written so the most significant 1 is on the left and the concatenated string is from left to right, A030302). a(n) is the number of times n written in binary appears disjointedly in the concatenated string.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 3, 1, 2, 1, 4, 3, 4, 5, 4, 1, 2, 2, 3, 2, 2, 1, 6, 3, 4, 4, 6, 6, 5, 7, 5, 1, 2, 2, 3, 1, 4, 3, 4, 2, 4, 2, 5, 2, 3, 4, 8, 3, 4, 5, 5, 4, 6, 4, 8, 6, 6, 6, 7, 9, 6, 9, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 2, 3, 5, 2, 6, 4, 5, 2, 4, 3, 6, 3, 3, 3, 7, 2, 5, 3, 5, 3, 7, 5, 10, 3, 4, 5, 5, 4, 7, 5, 7, 4, 6
Offset: 1

Views

Author

Keywords

Comments

First occurrence of n: 1, 3, 6, 11, 14, 23, 30, 47, 60, 95, 126, 124, 223, 248, 252, 447, 863, 504, 895, 1008, 1020, 1016, 1919, 2044, 2032, 2040, 3839, 7159, 7871, 4080, 7679, 15855, 8160, 8184, 8176, 15839, ??, 16376, 16352, 16368, ..., to a limit of 25000.

Examples

			a(21) = 2 because 21_10 = 10101_2 and that appears in
1101110010111011110001001101010111100110111101111100001000110010100111010010101_2
three times but only two times which do not overlap.
		

Crossrefs

Cf. A007088, A030190, A030302, A058935, A047778. Differs from A117127 at positions in A141439.

Programs

  • Mathematica
    a[n_] := StringCount[ ToString@ FromDigits@ Flatten@ IntegerDigits[ Range@n, 2], ToString@ FromDigits@ IntegerDigits[n, 2], Overlaps -> False]; Array[a, 105]

A179069 Array read by antidiagonals: row b lists the base-b analog of the base-10 sequence 1, 12, 123, ..., 123456789, 12345678910, ... (A007908).

Original entry on oeis.org

1, 1, 3, 1, 6, 6, 1, 5, 27, 10, 1, 6, 48, 220, 15, 1, 7, 27, 436, 1765, 21, 1, 8, 38, 436, 3939, 14126, 28, 1, 9, 51, 194, 6981, 35367, 113015, 36, 1, 10, 66, 310, 4855, 111702, 318310, 1808248
Offset: 1

Views

Author

Jonathan Vos Post, Jun 27 2010

Keywords

Comments

The numbers in the row b of the array are constructed in base b, but are converted to base 10 for display here.
R. K. Guy writes [UPINT, A3, pp. 9-10]: Selfridge asked if the sequence (in decimal notation) 1, 12, 123, 1234, ... [A007908] ... contains infinitely many primes.... The question can be asked for other scales of notation. There are (trivially) an infinite number of primes in the n=2 column, as that converges to k+2. In the n=3 column, the first prime is A[3,8] = 83 (base 10) = 123 (base 8). In the n=7 column, the first prime is A[8,7] = 342391 (base 10) = 1234567 (base 8). This can be continued to bases higher than 10, where A, B, C, ... are conventionally used as numerals. For example, A[12,5] = 12345 (base 12) = 24677 (base 10) is prime, as is A[12,17] = 656998737209054448298001 (base 10). A[13,3] = 227 (base 10) = 123 (base 13) is prime. Similarly, to pick the 9th row but go further than the table shown here, A[9,14] = 1709671414851143033 (base 10) is prime. Existing OEIS sequences stop at A048447, the concatenation of first n numbers in base 16.

Examples

			The array begins:
====================================================================
....|n=1.|.n=2.|.n=3.|.n=4.|..n=5.|..n=6.|...n=7.|.....n=8.|.in OEIS
b=1.|.1..|...3.|...6.|..10.|...15.|...21.|....28.|......36.|.A000217
b=2.|.1..|...6.|..27.|.220.|.1765.|.14126|.113015|.1808248.|.A047778
b=3.|.1..|...5.|..48.|.436.|.3929.|.35367|.318310|.2864798.|.A048435
b=4.|.1..|...6.|..27.|.436.|.6981.|111702|1787239|28595832.|.A048436
b=5.|.1..|...7.|..38.|.194.|.4855.|121381|3034532|75863308.|.A048437
b=6.|.1..|...8.|..51.|.310.|.1865.|.67146|2417263|87021476.|.A048438
b=7.|.1..|...9.|..66.|.466.|.3267.|.22875|1120882|54923226.|.A048439
b=8.|.1..|..10.|..83.|.668.|.5349.|.42798|.342391|21913032.|.A048440
...
b=10|.1..|..12.|.123.|1234.|12345.|123456|1234567|12345678.|.A007908
=====================================================================
		

References

  • Richard K. Guy, Unsolved Problems In Number Theory, 2nd Edn., Springer Verlag, 1994.

Crossrefs

Formula

A[b,n] = n-th integer concatenated from consecutive integers in base b.

Extensions

Should be revised to start with base 2, rather than the ill-defined "base 1". - N. J. A. Sloane, Jul 05 2010

A376295 The binary expansion of a(n) is the reversal of the concatenation of the binary expansions of 1,...,n.

Original entry on oeis.org

1, 3, 27, 59, 1339, 7483, 122171, 253243, 19127611, 186899771, 7166221627, 32936025403, 1544764513595, 16937927302459, 544703508634939, 1107653462056251, 307352428123249979, 5495499198854061371, 466664101041592851771, 3418143152835121110331, 400096927713885319060795
Offset: 1

Views

Author

Darío Clavijo, Sep 19 2024

Keywords

Examples

			For n = 4 a(4) = 59 because:
Concatenation:  1 10 11 100
Reversed order: 00111011
And 00111011 in base 10 is 59.
		

Crossrefs

Programs

  • Mathematica
    IntegerReverse[Module[{n = 1}, NestList[#*2^BitLength[++n] + n &, 1, 25]], 2] (* Paolo Xausa, Sep 30 2024 *)
  • Python
    a = lambda n: int("".join(bin(x)[2:] for x in range(1,n+1))[::-1],2)
    print([a(n) for n in range(1,22)])

Formula

a(n) = A030101(A047778(n)).

A175909 Decimal representation of the binary number formed by the concatenation of digits which are the same in both the left and right binary concatenations of the integers 1 to n.

Original entry on oeis.org

1, 1, 7, 46, 29, 219, 495, 1502, 368357, 27603, 120539, 1797358, 462906349, 32361431, 33008607, 12857291758, 5972138981, 750631865, 99509722923, 13841055262, 31762354574285, 1019248986603, 8645573738319287
Offset: 1

Views

Author

Dylan Hamilton, Oct 14 2010

Keywords

Crossrefs

Programs

  • Mathematica
    Module[{l,r,d},l = {}; r = {}; Table[d = IntegerDigits[x, 2]; l = Flatten[{l, d}]; r = Flatten[{d, r}]; FromDigits[ Pick[l, EvenQ[l + r]], 2], {x, 1, DESIRED_NUMBER_OF_TERMS}]]

A175910 Take the left or right binary concatenation of the numbers 1 to n, whichever is greater, delete digits identical to corresponding digits in the other concatenation, condense the remaining digits, and convert to decimal.

Original entry on oeis.org

0, 2, 2, 2, 44, 42, 178, 812, 52, 11682, 44585, 52778, 3222, 727657, 15264354, 928184, 60925872, 15976986770, 4166367305, 785545793868, 11730991244, 11804109800746, 41522369301, 3574301245885612, 198659132140236
Offset: 1

Views

Author

Dylan Hamilton, Oct 14 2010

Keywords

Crossrefs

Programs

  • Mathematica
    Module[{l,r,d,ldump,larger,rdump},l = {}; r = {}; Table[d = IntegerDigits[x, 2]; l = Flatten[{l, d}]; r = Flatten[{d, r}]; If[x > 1, ldump = l; rdump = r; While[First[ldump] == First[rdump], ldump = Rest[ldump]; rdump = Rest[rdump]]; If[First[ldump] == 1, larger = ldump, larger = rdump]; FromDigits[Pick[larger, OddQ[ldump + rdump]], 2], 0], {x, 1, DESIRED_NUMBER_OF_TERMS}]]

A175913 Convert to decimal the number resulting from performing binary xnor on the corresponding digits in the left and right binary concatenations of the integers one to n.

Original entry on oeis.org

1, 4, 25, 190, 1159, 15692, 111381, 1416474, 24608235, 291074808, 5162763209, 125052555486, 2198977618351, 28389504497340, 487294161504141, 11589641752262546, 395151697837143155, 13197172619557324880
Offset: 1

Views

Author

Dylan Hamilton, Oct 14 2010

Keywords

Crossrefs

Programs

  • Mathematica
    frombinrep[x_] := FromDigits[Flatten[Table[Table[If[OddQ[ n], 1, 0], {d, 1, x[[n]]}], {n, 1, Length[x]}]], 2]
    repcount[x_] := Length/@Split[x]
    l = {}; r = {}; Table[d = IntegerDigits[x, 2]; l = Flatten[{l, d}]; r = Flatten[{d, r}]; frombinrep[ repcount[EvenQ[l + r]]], {x, 1, DESIRED NUMBER OF TERMS HERE}]

A179075 Concatenation of the first n numbers in base n.

Original entry on oeis.org

6, 48, 436, 4855, 67146, 1120882, 21913032, 490328973, 12345678910, 345227121316, 10610896401084, 355457590375459, 12887297856859986, 502684312937210790, 20988295479420645136, 933876701895122362393, 44111544001370512713990, 2204350295349917301461848
Offset: 2

Views

Author

Jonathan Vos Post, Jun 27 2010

Keywords

Comments

Always divisible by n, hence never prime.

Examples

			a(2) = 110 (base 2) = 6 (base 10) = A047778(2).
a(3) = 1210 (base 3) = 48 (base 10) = A048435(3).
a(4) = 12310 (base 4) = 436 (base 10) = A048436(4).
a(5) = 123410 (base 5) = 4855 (base 10) = A048437(5).
a(11) = 123456789A10 (base 11) = 345227121316 (base 10).
a(16) = 123456789ABCDE10 (base 16) = 20988295479420645136 (base 10) = A048447(16).
		

Crossrefs

Programs

  • PARI
    {for(n=2,19,tlt=0;
    for(i=1,n-1,tlt=tlt+i*(n^(n+1-i)));
    print1(tlt+n, ", ") )} \\ Douglas Latimer, May 10 2012

Formula

a(n) = n + sum(i*(n^(n+1-i)), i=1..n-1).

Extensions

Edited (errors corrected, sequence extended) by Jon E. Schoenfield, Jul 05 2010 and Jul 06 2010
More terms from Douglas Latimer, May 10 2012
Previous Showing 21-30 of 30 results.