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

A342303 a(0) = 1; for n >= 1, a(n) = the decimal value of the binary number of the total binary digits back from the end of the concatenation of all previous binary terms where the binary value of n last appeared. If the binary value of n has not previously appeared then a(n) = 0.

Original entry on oeis.org

1, 1, 0, 3, 0, 5, 6, 4, 0, 0, 7, 14, 0, 16, 10, 15, 13, 0, 21, 0, 39, 10, 58, 8, 0, 49, 16, 81, 68, 36, 49, 72, 0, 39, 33, 25, 25, 0, 40, 16, 11, 106, 6, 7, 0, 9, 10, 26, 60, 85, 11, 70, 40, 9, 214, 30, 32, 52, 16, 0, 65, 30, 6, 226, 0, 24, 130, 161, 20, 0, 99, 0, 68, 216, 136, 0, 62, 26, 129
Offset: 0

Views

Author

Scott R. Shannon, Mar 07 2021

Keywords

Comments

The longest run of 0 terms, corresponding to binary values that have not previously appeared, for n up to 100000 is four, starting at n = 512. Not all powers of 2 are 0 as it may have appeared as a previous value's offset, e.g., a(65536) = 412323.

Examples

			a(1) = 1 as the binary string concatenation up to a(0) = '1', and the binary value of 1 is '1' which appears 1 (1_2) digit back from the end of the string.
a(2) = 0 as the binary string concatenation up to a(1) = '11', while the binary value of 2 is '10' which does not appear in the string.
a(3) = 3 as the binary string concatenation up to a(2) = '110', and the binary value of 3 is '11' which appears 3 (11_2) digits back from the end of the string.
a(5) = 5 as the binary string concatenation up to a(4) = '110110', and the binary value of 5 is '101' which appears 5 (101_2) digits back from the end of the string.
a(10) = 7 as the binary string concatenation up to a(9) = '11011010111010000', and the binary value of 10 is '1010' which appears 7 (111_2) digits back from the end of the string.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def agen():
        b = "1"
        yield 1
        for k in count(1):
            bk = bin(k)[2:]
            idx = b.rfind(bk)
            if idx == -1:
                yield 0
                b += "0"
            else:
                yield len(b) - idx
                b += bin(len(b) - idx)[2:]
    print(list(islice(agen(), 79))) # Michael S. Branicky, Mar 18 2022

A342127 Numbers m such that the product of m and the string m in reverse contains m as a substring.

Original entry on oeis.org

0, 1, 5, 6, 10, 47, 50, 60, 75, 78, 100, 125, 152, 457, 500, 600, 750, 1000, 1025, 1052, 1250, 1520, 5000, 5625, 6000, 7500, 10000, 10025, 10052, 10250, 10520, 12266, 12500, 15200, 23258, 43567, 50000, 56250, 60000, 62656, 75000, 82291, 90625, 98254, 100000, 100025, 100052, 100250, 100520
Offset: 1

Views

Author

Scott R. Shannon, Mar 01 2021

Keywords

Comments

Numerous patterns exist in the terms, e.g., all numbers of the form 1*10^k, 5*10^k, 6*10^k, 75*10^k, 10^(k+2)+25, where k>=0, are in the sequence.

Examples

			6 is a term as 6*reverse(6) = 6*6 = 36 contains '6' as a substring.
47 is a term as 47*reverse(47) = 47*74 = 3478 contains '47' as a substring.
1052 is a term as 1052*reverse(1052) = 1052*2501 = 2631052 contains '1052' as a substring.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,d,Lp,r,i;
      L:= convert(n,base,10);
      d:= nops(L);
      r:= add(L[-i]*10^(i-1),i=1..d);
      Lp:= convert(n*r,base,10);
      ormap(t -> Lp[t..t+d-1] = L, [$1..nops(Lp)+1-d])
    end proc:
    select(filter, [$0..120000]); # Robert Israel, Mar 24 2024
  • Mathematica
    Select[Range[0,110000],SequenceCount[IntegerDigits[# IntegerReverse[#]],IntegerDigits[#]]>0&] (* Harvey P. Dale, Apr 20 2024 *)
  • PARI
    isok(m) = #strsplit(Str(m*fromdigits(Vecrev(digits(m)))), Str(m)) > 1; \\ Michel Marcus, Mar 01 2021
    
  • Python
    def ok(n): return (s:=str(n)) in str(n*int(s[::-1]))
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Mar 25 2024
Showing 1-2 of 2 results.