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.

User: Dhilan Lahoti

Dhilan Lahoti's wiki page.

Dhilan Lahoti has authored 5 sequences.

A261751 Numbers n with property that binary expansion of n^3 begins with the binary expansion of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 8, 16, 23, 32, 64, 91, 128, 256, 512, 1024, 2048, 4096, 5793, 8192, 16384, 32768, 46341, 65536, 92682, 131072, 185364, 262144, 370728, 524288, 1048576, 2097152, 2965821, 4194304, 5931642, 8388608, 16777216, 33554432, 47453133, 67108864, 94906266
Offset: 1

Author

Dhilan Lahoti, Aug 30 2015

Keywords

Comments

2^k is always a term in this sequence.
It appears that all solutions are either a power of 2 or approximately sqrt(2) * a power of 2. - Andrew Howroyd, Dec 24 2019

Examples

			23 is a term of this sequence because its cube written in base 2 (10111110000111) starts with its representation in base 2 (10111).
		

Crossrefs

Base 2 version of A052210.
Cf. A004539.

Programs

  • Mathematica
    SetBeginSet[set1_, set2_] :=
      Do[For[i = 1, i <= Length[set1], i++,If[! set1[[i]] == set2[[i]], Return[False]]];Return[True], {1}];
    For[k = 0; set = {}, k <= 100000, k++,If[SetBeginSet[IntegerDigits[k, 2], IntegerDigits[k^3, 2]],Print[k]]]
  • PARI
    ok(n)={my(t=n^3); t == 0 || t>>(logint(t,2)-logint(n,2))==n} \\ Andrew Howroyd, Dec 23 2019
    
  • PARI
    \\ for larger values
    viable(b,k)={my(p=b^3, q=(b+2^k-1)^3, s=logint(q,2), t=s-logint(b,2)+k); (p>>s)==0 || ((p>>t)<=(b>>k) && (b>>k)<=(q>>t))}
    upto(n)={
      local(L=List([0]));
      my(recurse(b,k)=; if(b <= n && viable(b,k), k--; if(k<0, listput(L, b), self()(b,k); self()(b+2^k,k))));
      for(k=0, logint(n,2), recurse(2^k, k));
      Vec(L);
    } \\ Andrew Howroyd, Dec 24 2019

Extensions

Terms a(31) and beyond from Andrew Howroyd, Dec 23 2019

A261749 Numbers k where k^2 is an anagram of (k+2)^2.

Original entry on oeis.org

206, 224, 314, 1799, 2006, 11087, 13364, 15839, 17153, 17324, 20006, 22184, 22706, 24524, 24542, 40031, 40247, 45314, 47069, 48824, 55556, 61694, 64691, 70559, 71351, 89774, 90224, 102374, 108251, 112292, 129824, 132506, 137987, 151757, 154295, 157706, 162089, 167273, 170324, 171557, 175031
Offset: 1

Author

Dhilan Lahoti, Aug 30 2015

Keywords

Comments

Numbers of the form 2*10^k + 6 where k > 1 always appear in this sequence.
Numbers of the form 4*10^k + 31 and 86*10^k + 39 always appear when k > 3.
Similar to A072841 but with (n+2)^2 instead of (n+1)^2.
All numbers in the sequence are of the form 3n + 2.
Multiples of 5 seem to be uncommon.
Another subsequence is numbers of the form 5*(10^(5+9*k)-1)/9 + 1, i.e. 4+9*k 5's followed by a 6: 55556, 55555555555556, 55555555555555555555556, etc. - Robert Israel, Aug 31 2015

Examples

			206 is a term in the sequence because 206^2 (42436) and 208^2 (43264) are anagrams.
		

Crossrefs

Cf. A072841.

Programs

  • Maple
    filter:= proc(n) local L1, L2;
      L1:= convert(n^2,base,10);
      L2:= convert((n+2)^2,base,10);
      evalb(sort(L1)=sort(L2));
    end proc:
    select(filter, [3*i+2 $ i = 1..10^5]); # Robert Israel, Aug 31 2015
  • Mathematica
    Select[Range[10^4], Sort[IntegerDigits[#^2]] == Sort[IntegerDigits[(# + 2)^2]] &] (* Typo fixed by Ivan N. Ianakiev, Sep 02 2015 *)
  • PARI
    isok(n) = vecsort(digits(n^2)) == vecsort(digits((n+2)^2)); \\ Michel Marcus, Aug 31 2015
    
  • Python
    A261749_list = [n for n in range(1,10**6) if sorted(str(n**2)) == sorted(str((n+2)**2))] # Chai Wah Wu, Sep 02 2015

A260477 Numbers n where n^2 is an anagram of (n+1)^2 in base 2.

Original entry on oeis.org

9, 17, 33, 49, 50, 65, 73, 77, 85, 86, 97, 106, 129, 137, 149, 157, 161, 165, 178, 186, 193, 201, 212, 213, 225, 226, 257, 265, 273, 279, 281, 285, 300, 305, 307, 310, 317, 321, 325, 332, 334, 345, 355, 365, 366, 378, 385, 393, 394, 413, 426, 427, 449, 469
Offset: 1

Author

Dhilan Lahoti, Aug 28 2015

Keywords

Comments

Base 2 equivalent of A072841.
It appears that one of these numbers has a 1/n chance of being divisible by an odd number n, but a smaller than 1/n chance if n is even.

Examples

			17 is a term of the sequence because its square base 2 (100100001) and 18's square base 2 (101000100) are anagrams.
		

Programs

  • Mathematica
    For[i = 1, i <= 10000, i++,
    If[Sort[IntegerDigits[i^2, 2]] == Sort[IntegerDigits[(i + 1)^2, 2]],
      Print[i]]]
  • PARI
    is(n)=hammingweight(n^2)==hammingweight((n+1)^2) && #binary(n^2)==#binary((n+1)^2) \\ Charles R Greathouse IV, Aug 29 2015

Extensions

a(27)-a(54) from Charles R Greathouse IV, Aug 29 2015

A247107 a(0) = 0, a(n) = previous term + repunit of length of previous term for n > 0.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 21, 32, 43, 54, 65, 76, 87, 98, 109, 220, 331, 442, 553, 664, 775, 886, 997, 1108, 2219, 3330, 4441, 5552, 6663, 7774, 8885, 9996, 11107, 22218, 33329, 44440, 55551, 66662, 77773, 88884, 99995, 111106, 222217, 333328, 444439
Offset: 0

Author

Dhilan Lahoti, Nov 30 2014

Keywords

Examples

			98 = 9*10 + 8 -> 10*10 + 9 = 109.
109 = 1*100 + 0*10 + 9*1 -> 2*100 + 1*10 + 10*1 = 220.
a(42) = 44440 + (10^(floor(log_10(44440))+1)-1) / 9 = 44440 + (10^(4+1)-1) / 9 = 44440 + 99999/9 = 44440 + 11111 = 55551.
		

Crossrefs

Similar to A158699, but with simpler rules.

Programs

  • Mathematica
    a[0]=0; a[n_]:=FromDigits[IntegerDigits[a[n-1]]+1]; Array[a,50,0] (* Stefano Spezia, Sep 19 2024 *)

Formula

a(0) = 0, a(n) = a(n-1) + A002275(A055642(a(n-1))) for n>0.
From Jon E. Schoenfield, Nov 30 2014: (Start)
For n > 1, a(n) = a(n-1) + (10^(floor(log_10(a(n-1))) + 1) - 1) / 9.
For n > 0, a(n) = ((n-1) mod 9 + 1) * (10^D - 1) / 9 + 1 - D, where D = floor((n-1)/9) + 1. (There are exactly D digits in a(n).) (End)
G.f.: -(10*x^10-10*x^9+1)*x/((10*x^9-1)*(x-1)^2). - Alois P. Heinz, Nov 30 2014

A219735 a(n) = (a(n-2) * a(n-1))^2, with a(0) = 1 and a(1) = 2.

Original entry on oeis.org

1, 2, 4, 64, 65536, 17592186044416, 1329227995784915872903807060280344576
Offset: 0

Author

Dhilan Lahoti, Nov 26 2012

Keywords

Comments

Every one of these numbers is a power of 2.

Crossrefs

Cf. A000079.

Programs

  • Mathematica
    RecurrenceTable[{a[0]==1,a[1]==2,a[n]==(a[n-1]*a[n-2])^2},a,{n,7}] (* Harvey P. Dale, Apr 23 2015 *)

Formula

a(n) = 2^A002605(n).