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.

A167450 Smallest sequence which lists the position of digits "8" in the sequence.

Original entry on oeis.org

2, 8, 9, 10, 11, 88, 880, 900, 901, 902, 903, 904, 905, 906, 907, 909, 910, 911, 912, 913, 914, 915, 916, 917, 919, 920, 921, 922, 923, 924, 925, 926, 8000, 9000, 9001, 9002, 9003, 9004, 9005, 9006, 9007, 9009, 9010, 9011, 9012, 9013, 9014, 9015, 9016, 9017
Offset: 1

Views

Author

M. F. Hasler, Nov 19 2009

Keywords

Comments

The lexicographically earliest sequence such that a(1),a(2),a(3),... is the (increasing) list of the positions of digits "8" in the string obtained by concatenating all these terms, written in base 10.

Examples

			We cannot have a(1)=1 (since then there's no "8" in the first place), but a(1)=2 is possible.
This implies that a(2) must start with a digit "8", so a(2)=8 is the smallest possible choice.
This allows us to go on with a(3)=9, a(4)=10, a(5)=11, but then must be follow 4 digits "8" (the 8th through 11th digit of the sequence), so a(6)=88 and a(7)=880 are the smallest possible choices.
Then the reasoning continues in analogy with A167452-A167457.
		

Crossrefs

Programs

  • PARI
    concat([ [2,8,9,10,11,88,880], vector((88-11-1)\3,i,900-(i<=8)+i+(i>=18)), [8000], select(x->x%10-8 & x\10%10-8,vector((880-88)\4,i,9000-1+i)) ])

A167451 Smallest sequence which lists the position of digits "9" in the sequence.

Original entry on oeis.org

2, 9, 10, 11, 12, 99, 990, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1020, 1021, 1022, 1900, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012, 2013, 2014, 2015, 2016
Offset: 1

Views

Author

M. F. Hasler, Nov 19 2009

Keywords

Comments

The lexicographically earliest sequence such that a(1),a(2),a(3),... is the (increasing) list of the positions of digits "9" in the string obtained by concatenating all these terms, written in base 10.

Examples

			We cannot have a(1)=1 (since then there's no "9" in the first place), but a(1)=2 is possible.
This implies that a(2) must start with a digit "9", so a(2)=9 is the smallest possible choice.
This allows us to go on with a(3)=10, a(4)=11, a(5)=12, but then must be follow 4 digits "9" (the 9th through 12th digit of the sequence), so a(6)=99 and a(7)=990 are the smallest possible choices.
Then the reasoning continues in analogy with A167450-A167457.
		

Crossrefs

Programs

  • PARI
    concat([ [2,9,10,11,12,99,990], vector((99-11-1)\4,i,1000-(i<=9)+i+(i>=19)), [1900], select(x->x%10-9 & x\10%10-9,vector((990-99)\4,i,2000-1+i)) ])
    /* The following code checks a sequence for consistency (i.e., the given digit occurs exactly at positions given by the terms), but it does not check the monotonicity neither the minimality.
    In case of a contradiction, it returns [n,pos,d] where n is the index of the term, pos is the position in the concatenation, and d is the digit for which the contradiction occurred.
    If d is different from the given digit, the term a(n) said that there should be that digit at position pos, but we found d instead.
    If d equals the given digit, we found d at position pos, but the term a(n) said that the next d should occur elsewhere. */
    check_self(a,d=9)={ my(t=Vecsmall(concat(concat([""],a))),c=0); d+=48;
    for( i=1,#a, a[i]>#t & break; t[a[i]]==d || return([i,a[i],t[a[i]]-48]));
    for( i=1,#t, t[i]==d & (a[c++ ]==I || return([c,i,d-48]))) /* no contradiction => empty result */}
Showing 1-2 of 2 results.