A169930 Duplicate of A048379.
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, 20, 31, 32, 33, 34, 35, 36
Offset: 0
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.
From _Peter Bala_, Sep 27 2015: (Start) Continued fraction expansions showing large partial quotients: a(12)^(1/3) = [9999; 1, 299999998, 1, 9998, 1, 449999998, 1, 7998, 1, 535714284, 1, 2, 2, 142, 2, 2, 1, 599999999, 3, 1, 1,...]. Compare with a(30)^(1/3) = [9999999999; 1, 299999999999999999998, 1, 9999999998, 1, 449999999999999999998, 1, 7999999998, 1, 535714285714285714284, 1, 2, 2, 142857142, 2, 2, 1, 599999999999999999999, 3, 1, 1,...]. a(24)^(1/4) = [999999; 1, 3999999999999999998, 1, 666665, 1, 1, 1, 799999999999999999, 3, 476190, 7, 190476190476190476, 21, 43289, 1, 229, 1, 1864801864801863, 1, 4, 6,...]. Compare with a(48)^(1/4) = [999999999999; 1, 3999999999999999999999999999999999998, 1, 666666666665, 1, 1, 1, 799999999999999999999999999999999999, 3, 476190476190, 7, 190476190476190476190476190476190476, 21, 43290043289, 1, 229, 1, 1864801864801864801864801864801863, 1, 4, 6,...]. a(25)^(1/5) = [99999, 1, 499999999999999999998, 1, 49998, 1, 999999999999999999998, 1, 33332, 3, 151515151515151515151, 5, 1, 1, 1947, 1, 1, 38, 3787878787878787878, 1, 3, 5,...]. (End)
a002283 = subtract 1 . (10 ^) -- Reinhard Zumkeller, Feb 21 2014
[(10^n-1): n in [0..20]]; // Vincenzo Librandi, Apr 26 2011
Table[10^n - 1, {n, 0, 22}] (* Michael De Vlieger, Sep 27 2015 *)
A002283(n):=10^n-1$ makelist(A002283(n),n,0,20); /* Martin Ettl, Nov 08 2012 */
a(n)=10^n-1; \\ Charles R Greathouse IV, Jan 30 2012
def a(n): return 10**n-1 # Michael S. Branicky, Feb 25 2023
8 = 1000 -> 0111 = 111 = 7.
a035327 n = if n <= 1 then 1 - n else 2 * a035327 n' + 1 - b where (n',b) = divMod n 2 -- Reinhard Zumkeller, Feb 21 2014
using IntegerSequences A035327List(len) = [Bits("NAND", n, n) for n in 0:len] println(A035327List(100)) # Peter Luschny, Sep 25 2021
A035327:=func; // Jason Kimberley, Sep 19 2011
seq(2^(1 + ilog2(max(n, 1))) - 1 - n, n = 0..81); # Emeric Deutsch, Oct 19 2008 A035327 := n -> `if`(n=0, 1, Bits:-Nand(n, n)): seq(A035327(n), n=0..81); # Peter Luschny, Sep 23 2019
Table[BaseForm[FromDigits[(IntegerDigits[i, 2]/.{0->1, 1->0}), 2], 10], {i, 0, 90}] Table[BitXor[n, 2^IntegerPart[Log[2, n] + 1] - 1], {n, 100}] (* Alonso del Arte, Jan 14 2006 *) Join[{1},Table[2^BitLength[n]-n-1,{n,100}]] (* Paolo Xausa, Oct 13 2023 *) Table[FromDigits[IntegerDigits[n,2]/.{0->1,1->0},2],{n,0,90}] (* Harvey P. Dale, May 03 2025 *)
a(n)=sum(k=1,n,if(bitxor(n,k)>n,1,0)) \\ Paul D. Hanna, Jan 21 2006
a(n) = bitxor(n, 2^(1+logint(max(n,1), 2))-1) \\ Rémy Sigrist, Jan 04 2019
a(n)=if(n, bitneg(n, exponent(n)+1), 1) \\ Charles R Greathouse IV, Apr 13 2020
def a(n): return int(''.join('1' if i == '0' else '0' for i in bin(n)[2:]), 2) # Indranil Ghosh, Apr 29 2017
def a(n): return 1 if n == 0 else n^((1 << n.bit_length()) - 1) print([a(n) for n in range(100)]) # Michael S. Branicky, Sep 28 2021
def A035327(n): return (~n)^(-1<Chai Wah Wu, Dec 20 2022
def a(n): if n == 0: return 1 return sum([(1 - b) << s for (s, b) in enumerate(n.bits())]) [a(n) for n in srange(82)] # Peter Luschny, Aug 31 2019
a032810 = f 0 . (+ 1) where f y 1 = a004086 y f y x = f (10 * y + m + 2) x' where (x', m) = divMod x 2 -- Reinhard Zumkeller, Mar 18 2015
[n: n in [1..24000] | Set(Intseq(n)) subset {2, 3}]; // Vincenzo Librandi, May 27 2012
[n eq 1 select 2 else IsOdd(n) select 10*Self(Floor(n/2))+2 else Self(n-1)+1: n in [1..40]]; // Bruno Berselli, May 27 2012
Flatten[Table[FromDigits[#,10]&/@Tuples[{2,3},n],{n,5}]] (* Vincenzo Librandi, May 27 2012 *)
A032810(n)=vector(#n=binary(n+1)[2..-1],i,10^(#n-i))*n~+10^#n\9*2 \\ M. F. Hasler, Mar 26 2015
def A032810(n): return int(bin(n+1)[3:])+(10**((n+1).bit_length()-1)-1<<1)//9 # Chai Wah Wu, Jul 15 2023
13225 = 115^2 and 24336 = 156^2.
A:= {1}: for d from 1 to 96 do r:= (10^d-1)/9; f:= subs(X=10,factors((X^d-1)/(X-1))[2]); q:= map(t -> op(map(s -> [s[1],t[2]*s[2]], ifactors(t[1])[2])),f); divs:= {1}; for t in q do divs:= map(x -> seq(x*t[1]^j,j=0..t[2]),divs) od; for t in select(s -> s^2 > r, divs) do x:= (t + r/t)/2; if ilog10(x^2) = d-1 and x^2 > 2*10^(d-1) and not has(convert(x^2,base,10),0) then A:= A union {x^2}; fi od od: sort(convert(A,list)); # Robert Israel, Dec 30 2015
For[digits = 1, digits <= 30, digits++, n = (10^digits - 1)/9; divList = Select[Divisors[n], (#1 >= Sqrt[n])&]; For[j = 1, j <= Length[divList], j++, x = (divList[[j]] + n/divList[[j]])/2; y = (divList[[j]] - n/divList[[j]])/2; dx = IntegerDigits[x^2]; dy = IntegerDigits[y^2]; If[(Length[dx] == digits) && (Length[dy] == digits) && (Select[dx, (#1 == 0)&] == {}), Print[x^2]]]] Flatten@Prepend[Table[Select[#[[Ceiling[(Length[#] + 1)/2] ;;]] &@(# + Reverse@#)/2 &@Divisors[(10^n - 1)/9], IntegerLength[#^2] == n && (#[[1]] != 1 && FreeQ[#, 0]&[IntegerDigits[#^2]])&]^2, {n, 30}], 1] (* JungHwan Min, Dec 29 2015 *) Join[{1},Select[Select[Flatten[Table[#^2&/@(x/.Solve[{x^2-y^2 == FromDigits[ PadRight[{},n,1]],x>0,y>0},{x,y},Integers]),{n,2,30}]], DigitCount[ #,10,0]==0&&IntegerDigits[#][[1]]>1&]// Union,IntegerQ[ Sqrt[ FromDigits[IntegerDigits[#]-1]]]&]] (* Harvey P. Dale, Apr 16 2016 *)
13225 is in the sequence because (1) it is a square and (2) if we transform it we get 24336 and this is also a square.
Select[Range[0, 500000]^2, IntegerQ[Sqrt[FromDigits[(1 + IntegerDigits[ # ]) /. 10-> 0]]] &] (* Harvey P. Dale, Jan 21 2007 *)
f:= proc(n) local L,i; L:= convert(n,base,2); add((1-L[i])*10^(i-1),i=1..nops(L)) end proc: map(f, [$0..100]); # Robert Israel, Sep 17 2024
Table[FromDigits[IntegerDigits[n, 2] /. {0 -> 1, 1 -> 0}], {n, 0, 47}] (* or *) Table[FromDigits@ IntegerDigits[BitXor[n, 2^IntegerPart[Log[2, n] + 1] - 1], 2], {n, 0, 47}] (* Michael De Vlieger, Mar 22 2015, the latter based on Alonso del Arte at A035327 *)
A256078(n)=!n+eval(Strchr(apply(d->49-d,binary(n))))
def a(n): return int(bin(1 if n==0 else n^((1 << n.bit_length())-1))[2:]) print([a(n) for n in range(48)]) # Michael S. Branicky, Dec 21 2022
a(17) = 17*17 = 244: ...17 ...17 ----- ...84 (7*7 = 7+7 mod 10 = 4, 7*1 = 7+1 mod 10 = 8) ..28. ----- ..244 (The rule for "adding" the columns is to multiply mod 10: 8+8 = 8 * 8 mod 10 = 4. Blanks are ignored)
A169918(n)={u=vector(#n=digits(n),i,1);n=apply(d->n+d*u,n)%10;sum(i=0,2*#n-2,prod(j=max(1,#n-i),min(2*#n-1-i,#n),n[2*#n-i-j][j])%10*10^i)} \\ M. F. Hasler, Mar 26 2015
a(9) = 21 because 9 = "10" in base 9 becomes "21". a(80) = 0 because 80 = "88" in base 9 becomes "00".
A256289(n,b=9)=!n+eval(Strchr(apply(d->(d+1)%b+48, digits(n,b))))
a(3) = 7 because 3 = 10[3] becomes 21[3] = 7. a(8) = 0 because 8 = 22[3] becomes 00[3] = 0.
Table[FromDigits[IntegerDigits[n,3]/.{0->1,1->2,2->0},3],{n,0,100}] (* Harvey P. Dale, Jan 21 2019 *)
A256293(n,b=3)=!n+apply(t->(t+1)%b,n=digits(n,b))*vector(#n,i,b^(#n-i))~
Comments