This site is supported by donations to The OEIS Foundation.

User:Enrique Pérez Herrero/Salad

From OeisWiki
Jump to: navigation, search

FORMULAE SALAD

This is compilations of sequences that I egoistically need for other purposes, and it is very handy to have them already written somewhere:

NUMBER OF DIGITS

b Sequence Description
2 A029837 Binary order of n: log_2(n) rounded up to next integer.
2 A070939 Length of binary representation of n.
3 A081604 String-length of ternary representation of n.
4 A110591 String length of base 4 representation of n.
10 A055642 Number of digits in decimal expansion of n.


The expression can be extended to any real number :

[1]

[2]

Mathematica Programming

(* NUMBER OF DIGITS related OEIS sequences *)
Digits[x_,b_Integer:10]/;If[TrueQ[b > 1], True, Message[Digits::ibase, b]; False]:=Max[1+Floor[Log[b,Abs[x]]],1];
Digits::ibase="Base `1` is not an integer greater than 1";
A029837[n_]:=Ceiling[Log[2,n]];
A070939[n_]:=Digits[n,2];
A081604[n_]:=Digits[n,3];
A110591[n_]:=Digits[n,4];
A055642[n_]:=Digits[n];

(*Adding help*)
Digits::usage="Digits[x] gives the number of digits in the base 10 representation of the integer part of the real number x.
Digits[x,b] gives the number of digits in the base b representation of the integer part of x.";
A029837::usage="A029837: Binary order of n: log_2(n) rounded up to next integer.";
A055642::usage="A055642: Number of digits in decimal expansion of n.";
A070939::usage="A070939: Length of binary representation of n.";
A081604::usage="A081604: String-length of ternary representation of n.";
A110591::usage="A110591: String length of base 4 representation of n. String length of A007090.";

k*n digit-reversed mod k

k Sequence Description
2 A084052 2*n digit-reversed mod 2
3 A000004 3*n digit-reversed mod 3
4 A084053 4*n digit-reversed mod 4
5 A084054 5*n digit-reversed mod 5
6 A084055 6*n digit-reversed mod 6
7 A084339 7*n digit-reversed mod 7
8 A084340 8*n digit-reversed mod 8
9 A000004 9*n digit-reversed mod 9
10 A000030 10*n digit-reversed mod 10
13 A084341 13*n digit-reversed mod 13

Formulae for k*n digit-reversed mod k

Initial digit of n: A000030

Mathematica Programming:

(*Adding help*)
A000030::usage="A000030: Initial digit of n.";
A055642::usage="A055642: Number of digits in decimal expansion of n.";