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

A298232 The decimal expansion of the fractional part of a(n)/a(n+1) starts with a(n+1) (disregarding leading zeros); always choose the smallest possible positive integer not occurring earlier.

Original entry on oeis.org

1, 3, 17, 41, 10, 6, 77, 33, 7, 8, 28, 167, 1292, 382, 58, 14, 37, 192, 97, 89, 94, 59, 26, 161, 141, 1187, 71, 22, 148, 3847, 63, 79, 281, 95, 308, 66, 81, 90, 57, 2387, 288, 1697, 319, 1786, 669, 30, 173, 1315, 3626, 924, 20, 447, 67, 2588, 352, 593, 418, 86, 293, 98
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Jan 15 2018

Keywords

Comments

Numbers which can only appear as the first term of this sequence or the corresponding variant: 1, 2, 4, 5, 9, 11, 12, 13, 15, 16, 18, 19, 21, 23, 24, 25, 27, 29, 31, 32, 34, 35, 38, 39, 43, 44, 45, 46, 47, 48, 49, etc., i.e., A298981. - Robert G. Wilson v, Jan 17 2018
The sequence is infinite. There will always be a solution of the form floor(sqrt(a(n)*10^k)) with k sufficiently large (namely, choose k such that this is larger than a(n) and the fractional part is < 0.5). - M. F. Hasler, Jan 17 2018
a(2456) > 600000000. - Robert G. Wilson v, Jan 18 2018
a(2456) <= 7581556568. - M. F. Hasler, Jan 19 2018
If the constraint that a(n) be a term not occurring earlier were removed, the sequence would cycle {3, 17, 41, 10}. - Robert G. Wilson v, Feb 04 2018
Records: 1, 3, 17, 41, 77, 167, 1292, 3847, 80498, 83666, 390256, 536097, 886566, 2533515, 4881598, 275680975, 7581556568, 10669182255, 31559467676, ... - Robert G. Wilson v, Feb 05 2018

Examples

			1 divided by 3 is 0.3333333333... which shows "3" immediately after the decimal point;
3 divided by 17 is 0.1764705882... which shows "17" immediately after the decimal point;
17 divided by 41 is 0.4146341463... which shows "41" immediately after the decimal point;
41 divided by 10 is 4.1000000000... which shows "10" immediately after the decimal point;
10 divided by 6 is 1.6666666666... which shows "6" immediately after the decimal point;
6 divided by 77 is 0.07792207792... which shows "77" after the decimal point and the leading zero;
etc.
		

Crossrefs

Programs

  • Mathematica
    f[s_List] := Block[{k = 2, m = s[[-1]]}, While[k = g[k, m]; MemberQ[s, k], k++]; Append[s, k]]; g[k_, m_] := Block[{j, l = k}, While[j = 10^IntegerLength[l]*Mod[m, l]/l; While[0 < Floor@j < l, j *= 10]; Floor[j] != l, l++]; l]; Nest[f, {1}, 100] (* Robert G. Wilson v, Jan 16 2018 and revised Jan 31 2018 *)
  • PARI
    {u=[a=1]; (nxt()=for(b=u[1]+1,oo, !setsearch(u,b) && (f=frac(a/b)) && f\10^(-logint((b-1)\f,10)-1)==b&&return(b))); for(i=2,200, print1(a,","); u=setunion(u,[a=nxt()]));a} \\ M. F. Hasler, Jan 17 2018

Extensions

Corrected by Rémy Sigrist and Jacques Tramu, Jan 16 2018

A298982 a(n) is the least k for which the most significant decimal digits of k/n (disregarding any leading zeros) are n, or 0 if no such k exists.

Original entry on oeis.org

0, 0, 1, 0, 0, 4, 5, 7, 0, 1, 0, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 5, 0, 0, 0, 7, 0, 8, 0, 9, 0, 0, 11, 0, 0, 13, 14, 0, 0, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 33, 34, 35, 36, 0, 39, 4, 41, 0, 44, 45, 0, 48, 49, 51, 52, 54, 55, 0, 58, 6, 61, 63, 64, 66, 68, 69, 71, 73, 74, 76, 78, 8, 81, 83, 85, 87, 89, 91, 93, 95, 97, 0, 1
Offset: 1

Views

Author

Keywords

Comments

By decimal digits we mean those of the fractional part of k/n. Otherwise said, we require floor(10^m*k/n) = n for some k < n and m.
Indices of 0's are listed in A298981, indices of the other terms are listed in A298980.
It appears that the asymptotic density of 0's is slightly below 45%: The number of 0's among a(1..10^k) is (5, 42, 461, 4553, 45423, 451315, 4506142, 45017570, ...). Is there a simple estimate for the exact value? - M. F. Hasler, Feb 01 2018
There may be no asymptotic density: the fraction of 0's fluctuates too much. See the linked plot.

Examples

			a(1) = 0 since there does not exist any k such that k/1 has a decimal digit which begins with 1 (cf. comment).
a(6) = 4 since 4/6 = 0.666... and its decimal digit begins with 6.
a(28) = 8 since 8/28 = 0.28571428571428... even though 1/28 = 0.0357142857142857... has "28" as a subsequence.
		

Crossrefs

Programs

  • Maple
    f:= proc (n) local m, k;
      for m from ceil(log[10](n^2)) by -1 to 1 do
         k := ceil(n^2/10^m);
         if n <= k then return 0 end if;
         if k < n*(n+1)/10^m then return k end if
      end do;
      0
    end proc:
    map(f, [$1..200]); # Robert Israel, Feb 09 2018
  • Mathematica
    f = Compile[{{n, _Integer}}, Block[{k = 1, il = IntegerLength@ n}, While[m = 10^il*k/n; While[ IntegerLength@ Floor@ m < il, m *= 10]; k < n && Floor[m] != n, k++]; If[k < n, k, 0]]]; Array[f, 100]
  • PARI
    A298982(n,k=(n^2-1)\10^(logint(n,10)+1)+1)={k*10^(logint((n^2-(n>1))\k, 10)+1)\n==n && return(k\10^valuation(k,10))} \\ M. F. Hasler, Feb 01 2018

A298980 Numbers n such that there exists an integer k < n for which the significant decimal digits of k/n (i.e., neglecting leading zeros) are those of n.

Original entry on oeis.org

3, 6, 7, 8, 10, 14, 17, 20, 22, 26, 28, 30, 33, 36, 37, 40, 41, 42, 50, 57, 58, 59, 60, 62, 63, 64, 66, 67, 69, 70, 71, 72, 73, 74, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 100, 114, 118, 122, 126, 130, 134, 141, 148, 158, 161, 164, 167, 170, 173, 176, 184, 187
Offset: 1

Views

Author

Keywords

Comments

Otherwise said, floor(10^m*k/n) = n for some k and m.
Also, numbers n which have n as a subsequence in the decimal expansion of k/n, 0 < k < n.
Initially it appears that if n is present so is 10n and 11n. These two statements are false. 14 is present but 140 is not. 1/140 = 0.00714285... 17 is present but 187 is not.
However if there is a k between 0 and n so that gcd(k,n) = r > 1 and k/r is used to show that n/r is a term, then so is n. As an example, 33 is a term since 11/33 = 1/3 and 3 is a term. See the first example.
The density of numbers in this sequence appears to increase to above 55% near n ~ 10^9. See A298981 for the complement and A298982 for the k-values.

Examples

			3 is a term since 1/3 = 0.3333... and its fractional part begins with 3;
6 is a term since 10/6 = 1.666... and its fractional part begins with 6;
7 is a term since 5/7 = 0.714285... and its fractional part begins with 7;
8 is a term since 7/8 = 0.87500... and its fractional part begins with 8;
10 is a term since 1/10 = 0.1000... and its fractional part begins with 10;
14 is a term since 2/14 = 0.142857... and its fractional part begins with 14;
17 is a term since 3/17 = 0.17647058823... and its fractional part begins with 17; etc.
		

Crossrefs

Inspired by and equal to the range (= sorted terms) of A298232.
Complement of A298981.

Programs

  • Mathematica
    fQ = Compile[{{n, _Integer}}, Block[{k = 1, il = IntegerLength@ n}, While[m = 10^il*k/n; While[ IntegerLength@ Floor@ m < il, m *= 10]; k < n && Floor[m] != n, k++]; k < n]]; Select[Range@200, fQ]
  • PARI
    is_A298980(n,k=(n^2-1)\10^(logint(n,10)+1)+1)={k*10^(logint((n^2-(n>1))\k,10)+1)\n==n} \\ Or use A298982 to get the k-value if n is in this sequence or 0 otherwise. \\ M. F. Hasler, Feb 01 2018
Showing 1-3 of 3 results.